| 44 | } |
| 45 | |
| 46 | Vector3 Tr2CurveVector3Lerp::LerpToFirstKey( double time ) const |
| 47 | { |
| 48 | Vector3 curveStartValue; |
| 49 | m_curve->GetValueAt( &curveStartValue, 0.0 ); |
| 50 | |
| 51 | if( m_curveStartTime <= 0.0 ) |
| 52 | { |
| 53 | return curveStartValue; |
| 54 | } |
| 55 | else if( m_startInterpolation == Tr2CurveVector3LerpKeyInterpolation::LINEAR ) |
| 56 | { |
| 57 | return Lerp( m_initialValue, curveStartValue, (float)time / m_curveStartTime ); |
| 58 | } |
| 59 | else |
| 60 | { |
| 61 | Vector3 prev = m_initialValue; |
| 62 | Vector3 next = curveStartValue; |
| 63 | |
| 64 | float s = (float)time / m_curveStartTime; |
| 65 | |
| 66 | float c2 = -2.0f * s * s * s + 3.0f * s * s; |
| 67 | float c1 = 1.0f - c2; |
| 68 | |
| 69 | // Hermite with 0 tangents |
| 70 | return prev * c1 + next * c2; |
| 71 | } |
| 72 | |
| 73 | return Vector3( 0, 0, 0 ); |
| 74 | } |
| 75 | |
| 76 | Vector3* Tr2CurveVector3Lerp::Update( Vector3* in, Be::Time time ) |
| 77 | { |
nothing calls this directly
no test coverage detected