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

Method updateWorldData

Engine/modules/Verve/VPath/VPathNode.cpp:414–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414void VPathNode::updateWorldData( void )
415{
416 if ( !mPath )
417 {
418 setWorldPosition( getLocalPosition() );
419 setWorldRotation( getLocalRotation() );
420 return;
421 }
422
423 // Fetch Path Details.
424 const MatrixF &pathTransform = mPath->getTransform();
425 const QuatF &pathRotation( pathTransform );
426
427 // Calculate the World Position.
428 Point3F newPosition = getLocalPosition();
429 newPosition.convolve( mPath->getScale() );
430 pathTransform.mulP( newPosition );
431
432 // Calculate the new Rotation.
433 QuatF newRotation;
434 newRotation.mul( getLocalRotation(), pathRotation );
435
436 // Apply.
437 setWorldPosition( newPosition );
438 setWorldRotation( newRotation );
439}
440
441//-----------------------------------------------------------------------------
442//

Callers 1

addNodeMethod · 0.45

Calls 5

mulPMethod · 0.80
getTransformMethod · 0.45
convolveMethod · 0.45
getScaleMethod · 0.45
mulMethod · 0.45

Tested by

no test coverage detected