Last active
August 29, 2015 13:59
-
-
Save Neill3d/10719256 to your computer and use it in GitHub Desktop.
Get FBModel class pointer from a relation box
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the input node. | |
mNodeMesh = AnimationNodeInCreate( 0, "Mesh", ANIMATIONNODE_TYPE_VECTOR ); | |
// ... | |
/************************************************ | |
* Real-time engine evaluation | |
************************************************/ | |
bool Box_RayIntersect::AnimationNodeNotify( HFBAnimationNode pAnimationNode, HFBEvaluateInfo pEvaluateInfo ) | |
{ | |
/* | |
* 1. Read the data from the in connector | |
* 2. Treat the data as required | |
* 3. Write the data to the out connector | |
* 4. Return the status (LIVE/DEAD) of the box. | |
*/ | |
FBVector3d lMeshVector; | |
int lStatus; // Status of input node | |
// Read the input nodes. | |
lStatus = mNodeMesh->ReadData( lMeshVector, pEvaluateInfo ); | |
// If the read was not from a dead node. | |
if( lStatus != CNT_STATUS_DEAD ) | |
{ | |
int count = mNodeMesh->GetSrcCount(); | |
for (int i=0; i<count; ++i) | |
{ | |
HFBPlug pPlug = mNodeMesh->GetSrc(i); | |
pPlug = pPlug->GetOwner(); | |
if (pPlug->Is( FBModelPlaceHolder::TypeInfo ) ) | |
{ | |
HFBModelPlaceHolder pPlaceHolder = (HFBModelPlaceHolder) pPlug; | |
HFBModel pModel = pPlaceHolder->Model; | |
FBString name = pModel->Name; | |
printf( "%s\n", name ); | |
} | |
} | |
} | |
return CNT_STATUS_DEAD; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment