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

Method Sort

trinity/TriRigidOrientation.cpp:182–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void TriRigidOrientation::Sort()
183{
184 mStates.Sort( (IList::CompareFn)CompareKeys, NULL );
185 mCurrKey = 0;
186
187 // go over all the keys and set the correct
188 // initial states by extrapolating from the state before
189 for( int i = 1; i < mStates.GetSize(); i++ )
190 {
191 TriTorque* cs = mStates[i];
192 TriTorque* cs_1 = mStates[i - 1];
193 float time = cs->mTime - cs_1->mTime;
194 TriVectorExponentialDecay(
195 &cs->mOmega0,
196 &cs_1->mOmega0,
197 &cs_1->mTorque,
198 mI,
199 mDrag,
200 time );
201 Vector3 ZeroVec( 0.0f, 0.0f, 0.0f );
202 TriVectorExponentialDecayInteger(
203 &mTauVector,
204 &ZeroVec,
205 &cs_1->mOmega0,
206 &cs_1->mTorque,
207 mI,
208 mDrag,
209 time );
210 mTauConverter.x = mTauVector.x;
211 mTauConverter.y = mTauVector.y;
212 mTauConverter.z = mTauVector.z;
213 mTauConverter.w = 0.0f;
214 mTauConverter = Exp( mTauConverter );
215 cs->mRot0 = cs_1->mRot0 * mTauConverter;
216 }
217 if( mStates.GetSize() > 0 )
218 {
219 mValue = mStates[0]->mRot0;
220 }
221}

Callers

nothing calls this directly

Calls 3

GetSizeMethod · 0.45

Tested by

no test coverage detected