| 412 | } |
| 413 | |
| 414 | void 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 | // |