--------------------------------------------------------------------------------
| 26 | |
| 27 | // -------------------------------------------------------------------------------- |
| 28 | float GetAutoTangent( float prevTime, float prevValue, float time, float value, float nextTime, float nextValue ) |
| 29 | { |
| 30 | float left = 0; |
| 31 | if( time - prevTime > EPSILON ) |
| 32 | { |
| 33 | left = ( value - prevValue ) / ( time - prevTime ); |
| 34 | } |
| 35 | float right = 0; |
| 36 | if( nextTime - time > EPSILON ) |
| 37 | { |
| 38 | right = ( nextValue - value ) / ( nextTime - time ); |
| 39 | } |
| 40 | |
| 41 | float x = ( time - prevTime ) / ( nextTime - prevTime ); |
| 42 | return left * ( 1 - x ) + right * x; |
| 43 | } |
| 44 | |
| 45 | // -------------------------------------------------------------------------------- |
| 46 | float GetAutoClamppedTangent( float prevTime, float prevValue, float time, float value, float nextTime, float nextValue ) |
no outgoing calls
no test coverage detected