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

Method GetValue

trinity/Curves/Tr2FollowCurveKey.cpp:101–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101Vector3 Tr2ObjectFollowCurveKey::GetValue()
102{
103 if( m_object == nullptr )
104 {
105 return m_offset;
106 }
107
108 Vector3 offset = m_offset;
109 if( m_locator != nullptr )
110 {
111 offset += m_locator->position;
112 }
113
114 Matrix rotationMatrix;
115 switch( m_rotationSetting )
116 {
117 case LOCATOR_ROTATION:
118 rotationMatrix = GetLocatorRotation();
119 break;
120 case MODEL_ROTATION:
121 rotationMatrix = GetModelRotation();
122 break;
123 case NO_ROTATION:
124 default:
125 rotationMatrix = Matrix();
126 break;
127 }
128
129 m_rotatedLeftTangent = TransformCoord( m_leftTangent, rotationMatrix );
130 m_rotatedRightTangent = TransformCoord( m_rightTangent, rotationMatrix );
131
132 // rotate the offset
133 offset = TransformCoord( offset, rotationMatrix );
134
135 if( IWorldPositionPtr wp = BlueCastPtr( m_object ) )
136 {
137 return wp->GetWorldPosition() + offset;
138 }
139
140 return offset;
141}
142
143
144Tr2CameraFollowCurveKey::Tr2CameraFollowCurveKey( IRoot* lockobj ) :

Callers

nothing calls this directly

Calls 2

MatrixClass · 0.50
GetWorldPositionMethod · 0.45

Tested by

no test coverage detected