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

Method Init

trinity/Tr2ScalingTool.cpp:481–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479
480
481void Tr2ScalingTool::Init( Matrix& initialTransform )
482{
483 // Extract the scaling and translation
484 Vector3 scaling;
485 Vector3 pos;
486 Quaternion rotation;
487 Matrix rotationMatrix;
488 Decompose( scaling, rotation, pos, initialTransform );
489 rotationMatrix = RotationMatrix( rotation );
490
491 m_localTransform = TranslationMatrix( pos );
492 m_localTransform = rotationMatrix * m_localTransform;
493
494 Matrix translation = TranslationMatrix( m_pivot );
495 m_worldTransform = m_localTransform * translation;
496 ResetPrimitives();
497 // Compute initial length when captured
498 Vector3 vecA, vecB, vecC;
499 vecA.x = m_worldTransform._41;
500 vecA.y = m_worldTransform._42;
501 vecA.z = m_worldTransform._43;
502 vecB = m_xBox->GetCenterOfMass();
503
504 m_initialLength = -1;
505 m_scale = scaling;
506 m_initialScale = scaling;
507}

Callers

nothing calls this directly

Calls 1

GetCenterOfMassMethod · 0.80

Tested by

no test coverage detected