This example function illustrates how to fined a named Performer  Dynamic Coordinate System (DCS) pfDCS node that is part of the given pfNode sub-tree.

 

Note that the pfFindNode function is case sensitive.

 

Also you should be aware that if the pfNode is an OpenFlight file and the node uses the default name; such as dof1 and has not had its position  altered, then the node might get removed during the flatten and clean process done by default after the file is loaded.

 

It is good practice to name all Dof/Lod/Switch nodes or any  node of importance, this practice will save you time when debugging

 

 
   
 

 

 
 
 
 

 

#include "pf.h"          // Required for the standard Performer classes
#include "pfutil.h"      // Required for pfFindNode


pfDCS*
findNamedDCSNodeInNode( pfNode
*node , const char *dcsName ) {
// #################################################################
// # Public Function
// #
// # Attempts to find the named Performer pfD CS Node (DOF Bead)
// # within the passed node
// #
// # return a pointer to the performer pfDCS node if founD
// #
// # return NULL otherwise
// #
// #################################################################

pfDCS  
*dcsNode = NULL;
pfNode
*node    = NULL;

    //
    // Sanity check we need an n ode
    //

   
 if( node 
== NULL )
       
 return NULL;

    //
    // Find the Named DCS/DOF node in the performer tree
    // Note the name search is case sensitive
    //


   dcsNode
= (pfDCS *)pfFindNode( node, dcsName, pfGetDCSClassType());

return dcsNode;

}
// findNamedDCSNodeInNode

 

 
 

 

 

Copyright 2004 Gordon Tomlinson  All Rights Reserved.

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