MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / setPathObjectNode

Method setPathObjectNode

Engine/source/Verve/VPath/VPath.cpp:3295–3317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3293}
3294
3295void VPath::setPathObjectNode( SceneObject *pObject, const S32 &pNodeIndex )
3296{
3297 VPathObject *pathObject = getPathObject( pObject );
3298 if ( !pathObject )
3299 {
3300 Con::warnf( "VPath::setPathObjectNode() - Object (%d) Not Attached to Path.", pObject->getId() );
3301 return;
3302 }
3303
3304 // Source & Destination Nodes.
3305 const S32 srcNode = pNodeIndex;
3306 const S32 dstNode = ( pathObject->isForward() ) ? ( pNodeIndex + 1 ) : ( pNodeIndex - 1 );
3307
3308 // Set Current Node.
3309 pathObject->setNode( normalizeNodeIndex( srcNode ), normalizeNodeIndex( dstNode ) );
3310
3311 // Reset Interp.
3312 pathObject->setTimeInterp( 0.f );
3313 pathObject->setPathInterp( 0.f );
3314
3315 // Network Flags.
3316 setMaskBits( ObjectUpdateMask );
3317}
3318
3319DefineEngineMethod( VPath, getPathObjectEndNode, S32, (SceneObject *sceneObject), (nullAsType<SceneObject*>()), "( SimObject pObject ) - Get the index of the node this object is meant to stop upon reaching.\n"
3320 "@param pObject The SimObjectID of the object being observed.\n"

Callers 1

VPath.cppFile · 0.45

Calls 5

getIdMethod · 0.65
warnfFunction · 0.50
setNodeMethod · 0.45
setTimeInterpMethod · 0.45
setPathInterpMethod · 0.45

Tested by

no test coverage detected