19 int numRotations,
int numScales,
const Transform& localTransform)
31 if (numCommonTimes > 0)
36 if (numTranslations > 0)
59 if (numTranslations > 0)
89 float ctrlTime =
static_cast<float>(
GetControlTime(applicationTime));
90 float normTime = 0.0f;
154 int& lastIndex,
float& normTime,
int& i0,
int& i1)
156 if (ctrlTime <= times[0])
165 if (ctrlTime >= times[numTimes - 1])
168 lastIndex = numTimes - 1;
175 if (ctrlTime > times[lastIndex])
177 nextIndex = lastIndex + 1;
178 while (ctrlTime >= times[nextIndex])
180 lastIndex = nextIndex;
186 normTime = (ctrlTime - times[i0]) / (times[i1] - times[i0]);
188 else if (ctrlTime < times[lastIndex])
190 nextIndex = lastIndex - 1;
191 while (ctrlTime <= times[nextIndex])
193 lastIndex = nextIndex;
199 normTime = (ctrlTime - times[i0]) / (times[i1] - times[i0]);
std::vector< float > mTranslationTimes
virtual ~KeyframeController()
ControlledObject * mObject
static void GetKeyInfo(float ctrlTime, int numTimes, float *times, int &lastIndex, float &normTime, int &i0, int &i1)
GLenum GLenum GLenum GLenum GLenum scale
Quaternion< Real > Slerp(Real t, Quaternion< Real > const &q0, Quaternion< Real > const &q1)
std::vector< float > mCommonTimes
KeyframeController(int numCommonTimes, int numTranslations, int numRotations, int numScales, Transform const &localTransform)
std::vector< float > mScales
double GetControlTime(double applicationTime)
virtual bool Update(double applicationTime)
virtual bool Update(double applicationTime)
Matrix4x4< float > GetRotate(float normTime, int i0, int i1)
std::vector< Vector4< float > > mTranslations
std::vector< float > mScaleTimes
std::vector< Quaternion< float > > mRotations
GLdouble GLdouble GLdouble GLdouble q
Vector4< float > GetTranslate(float normTime, int i0, int i1)
float GetScale(float normTime, int i0, int i1)
std::vector< float > mRotationTimes