How to Set the Visible Switch Node

 

Vega Code Example

 

 

 

 

 

 

 
 

This simple example function illustrates how to set the current visible Performer pfSwitch node

Use findNamedSwitchNodeInVgObject to find a pfSwitch instance

 

 
   
 

 

 
 
 
 

 

#include "vg.h"          // Required for the standard Vega classes
#include "pf.h"          // Required for the standard Performer classes

  

void

setCurrentSwitchChild( pfSwitch *swNode, const int child ){

// ##################################################################

// #

// # Public function

// #

// # This function sets the current the switch child to display

// #

// # Note that for an pfSwitch created from loading an Openflight

// # file will create a Switch mask node which is used to control

// # which of the actual geometry child nodes are display, this

// # means that you can have more than one child displayed,

// #

// # See MultiGen-Paradigm Creator online help for more information on masks

// #    

// # On the other handif this node was created by code or another

// # file format then the switch will set individual nodes

// #    

// #################################################################

 

    //

    // Sanity check we need a pointer

    //

    if( swNode == NULL )

        return;

 

    pfSwitchVal( swNode, child );

 

 

} // setCurrentSwitchChild

 

 

 
 

 

 

Copyright 2004 Gordon Tomlinson  All Rights Reserved.

All logos, trademarks and copyrights in this site are property of their respective owner.