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

Method PostPhysicsUpdate

trinity/Tr2SkinnedObject.cpp:83–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void Tr2SkinnedObject::PostPhysicsUpdate( Be::Time time, Tr2ApexScene* apexScene )
84{
85 CCP_STATS_ZONE( __FUNCTION__ );
86
87 const Be::Time deltaTime = time - m_lastUpdateTime;
88 if( TimeAsFloat( deltaTime ) < m_updatePeriod )
89 {
90 return;
91 }
92
93 m_lastUpdateTime = time;
94
95 for( TriCurveSetVector::const_iterator it = m_curveSets.begin(); it != m_curveSets.end(); ++it )
96 {
97 ( *it )->Update( TimeAsDouble( time ) );
98 }
99
100 if( m_visualModel == NULL || m_visualModel->GetSkeleton() == NULL )
101 {
102 return;
103 }
104
105 if( m_animationUpdater != NULL )
106 {
107 m_animationUpdater->PostPhysicsAnimation( time, m_transform );
108 }
109
110 UpdateBones( time, apexScene );
111
112
113 // Update the translation if we have a worldtranslation updater
114 if( m_worldTransformUpdater != NULL )
115 {
116 m_worldTransformUpdater->UpdateTransform( time, &m_transform );
117 }
118
119 // Check LOD
120
121
122 if( m_lod.UnloadLodIfNeeded( time, deltaTime ) )
123 {
124 m_visualModel = NULL;
125 }
126
127 return;
128}
129
130void Tr2SkinnedObject::UpdateBones( Be::Time time, Tr2ApexScene* apexScene )
131{

Callers

nothing calls this directly

Calls 7

UnloadLodIfNeededMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
UpdateMethod · 0.45
GetSkeletonMethod · 0.45
PostPhysicsAnimationMethod · 0.45
UpdateTransformMethod · 0.45

Tested by

no test coverage detected