MCPcopy Create free account
hub / github.com/carbonengine/trinity / UpdateAsyncronous

Method UpdateAsyncronous

trinity/Eve/SpaceObject/EveSpaceObject2.cpp:599–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597}
598
599void EveSpaceObject2::UpdateAsyncronous( const EveUpdateContext& updateContext )
600{
601 m_boneOffsets.AdvanceFrame();
602
603 if( !m_update )
604 {
605 return;
606 }
607
608 float controllerUpdateFrequency = 0.f;
609
610 if( m_isVisible )
611 {
612 float ht = updateContext.GetHighDetailThreshold();
613 if( ht > 0.f )
614 {
615 controllerUpdateFrequency = min( 1.f, m_estimatedPixelDiameter / updateContext.GetHighDetailThreshold() );
616 }
617 }
618
619 for( auto it = begin( m_controllers ); it != end( m_controllers ); ++it )
620 {
621 ( *it )->Update( controllerUpdateFrequency );
622 }
623
624 Be::Time time = updateContext.GetTime();
625
626 m_perObjectDataVs.InvalidateBufferData();
627 m_perObjectDataPs.InvalidateBufferData();
628
629 float prevActivationStrength = m_spaceObjectShipData.y;
630 PrepareShaderData( updateContext );
631 if( prevActivationStrength != m_spaceObjectShipData.y )
632 {
633 SetControllerVariable( "ActivationStrength", m_spaceObjectShipData.y );
634 }
635
636 m_psData.shipData = m_spaceObjectShipData;
637 m_vsData.worldTransform = Transpose( m_worldTransform );
638 m_vsData.invWorldTransform = Transpose( m_invWorldTransform );
639 m_vsData.shipData = m_spaceObjectShipData;
640
641 Vector3 shapeCenter( 0.f, 0.f, 0.f ), shapeRadius( 0.f, 0.f, 0.f );
642 GetShapeEllipsoid( shapeCenter, shapeRadius );
643 m_vsData.ellpsoidRadii = Vector4( shapeRadius, 0.f );
644 m_vsData.ellpsoidCenter = Vector4( shapeCenter, 0.f );
645
646 m_psData.worldTransform = m_vsData.worldTransform;
647 m_psData.invWorldTransform = m_vsData.invWorldTransform;
648
649 if( m_impactOverlay )
650 {
651 m_psData.impactDataOffset = (float)m_impactOverlay->GetDataTextureOffset();
652 }
653
654 for( size_t i = 0; i < EVE_SPACEOBJECT_CUSTOWMASK_MAX; ++i )
655 {
656 if( m_customMasks.size() > i )

Callers

nothing calls this directly

Calls 15

TransposeFunction · 0.85
GetBoneListFunction · 0.85
AdvanceFrameMethod · 0.80
InvalidateBufferDataMethod · 0.80
GetDataTextureOffsetMethod · 0.80
sizeMethod · 0.80
FillPerObjectDataMethod · 0.80
emptyMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
Vector4Class · 0.50

Tested by

no test coverage detected