| 3293 | } |
| 3294 | |
| 3295 | void 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 | |
| 3319 | DefineEngineMethod( 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" |
no test coverage detected