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

Method Update

trinity/Eve/Renderable/EveSceneStaticParticles.cpp:90–105  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: Update. Mainly calculate a new worldmatrix based on the ever changing ego pos --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

88// Update. Mainly calculate a new worldmatrix based on the ever changing ego pos
89// --------------------------------------------------------------------------------
90void EveSceneStaticParticles::Update( const EveUpdateContext& updateContext )
91{
92 // nothing to do here?
93 if( Tr2Renderer::IsLowQuality() || m_clusters.empty() || !m_mesh )
94 {
95 return;
96 }
97
98 m_lastWorldMatrix = m_worldMatrix;
99 // calc float offset from egopos to center of particles
100 Vector3d offset = m_centerOfClusters - updateContext.GetOrigin();
101 // build a transform matrix
102 m_worldMatrix = TranslationMatrix( float( offset.x ), float( offset.y ), float( offset.z ) );
103
104 m_center = TransformCoord( m_boundingSphere.GetXYZ(), m_worldMatrix );
105}
106
107void EveSceneStaticParticles::UpdateVisibility( const EveUpdateContext& updateContext )
108{

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.80
GetOriginMethod · 0.80

Tested by

no test coverage detected