| 495 | } |
| 496 | |
| 497 | void EveSpaceObject2::UpdateSyncronous( const EveUpdateContext& updateContext ) |
| 498 | { |
| 499 | Be::Time time = updateContext.GetTime(); |
| 500 | |
| 501 | UpdateWorldTransform( time ); |
| 502 | |
| 503 | if( !m_update ) |
| 504 | { |
| 505 | return; |
| 506 | } |
| 507 | |
| 508 | // Particle Systems |
| 509 | // Get the reference position |
| 510 | Vector3d referencePosition( 0.0, 0.0, 0.0 ); |
| 511 | IEveReferencePointPtr refObject( BlueCastPtr( m_ballPosition ) ); |
| 512 | if( refObject ) |
| 513 | { |
| 514 | refObject->GetReferencePoint( &referencePosition, time ); |
| 515 | } |
| 516 | |
| 517 | if( m_previousPosition.x != UNINITIALIZED_POSITION ) |
| 518 | { |
| 519 | Vector3 positionDelta( |
| 520 | float( referencePosition.x - m_previousPosition.x ), |
| 521 | float( referencePosition.y - m_previousPosition.y ), |
| 522 | float( referencePosition.z - m_previousPosition.z ) ); |
| 523 | m_positionDelta->m_value = TransformNormal( positionDelta, m_invWorldTransform ); |
| 524 | } |
| 525 | else |
| 526 | { |
| 527 | m_positionDelta->m_value = Vector3( 0.f, 0.f, 0.f ); |
| 528 | } |
| 529 | m_previousPosition = referencePosition; |
| 530 | |
| 531 | // |
| 532 | // Animation |
| 533 | // |
| 534 | if( m_animationUpdater ) |
| 535 | { |
| 536 | m_animationUpdater->PrePhysicsAnimation( 0, IdentityMatrix() ); |
| 537 | } |
| 538 | |
| 539 | if( EveLODHelper::ShouldUpdate( m_lodLevelWithChildren, float( TimeAsDouble( time - m_lastCurveUpdateTime ) ) ) ) |
| 540 | { |
| 541 | // overlay effect curves need to be updated on game thread because they may have references to this object's |
| 542 | // attributes, particularly to clipSphereFactor, which is not thread safe at the moment |
| 543 | m_lastCurveUpdateTime = time; |
| 544 | for( auto it = m_overlayEffects.begin(); it != m_overlayEffects.end(); ++it ) |
| 545 | { |
| 546 | ( *it )->Update( time, time ); |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | TriObserverLocalVector::iterator observersEnd = m_observers.end(); |
| 551 | Matrix observerTransform = GetObserverTransform(); |
| 552 | for( TriObserverLocalVector::iterator it = m_observers.begin(); it != observersEnd; ++it ) |
| 553 | { |
| 554 | ( *it )->Update( observerTransform ); |
nothing calls this directly
no test coverage detected