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

Method Update

trinity/Tr2TranslationTool.cpp:302–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void Tr2TranslationTool::Update()
303{
304 if( m_moved )
305 {
306 Matrix temp;
307 Matrix translation = TranslationMatrix( m_movement );
308 temp = m_localTransform * translation;
309 // Check the move callback for if we should be moving or not
310 if( OnMoveCallback( m_localTransform, temp ) )
311 {
312 m_localTransform = temp;
313 m_translation.x = m_localTransform._41;
314 m_translation.y = m_localTransform._42;
315 m_translation.z = m_localTransform._43;
316 m_movement.x = 0.0f;
317 m_movement.y = 0.0f;
318 m_movement.z = 0.0f;
319 }
320 m_moved = false;
321 }
322
323 Matrix translation = TranslationMatrix( m_pivot );
324 m_worldTransform = m_localTransform * translation;
325 for( PrimitiveIterator it = m_primitives.begin(); it != m_primitives.end(); ++it )
326 {
327 ( *it )->m_localTransform = m_localTransform;
328 ( *it )->UpdateTransform();
329 }
330}

Callers

nothing calls this directly

Calls 3

beginMethod · 0.45
endMethod · 0.45
UpdateTransformMethod · 0.45

Tested by

no test coverage detected