#ifndef __MOTIONPATH_H #define __MOTIONPATH_H #include "common.h" #include "Vector3.h" namespace CHCDemoEngine { /** Represents a vertex track for animation */ class MotionPath { public: /** Constructor for a vertex path. The first vertex is also the starting point of the motion */ MotionPath(const VertexArray &vertices); /** Moves forward using the given velocity */ void Move(float velocity); /** Gets current position on track. */ Vector3 GetCurrentPosition() const; /** Gets the current direction direction. */ Vector3 GetCurrentDirection() const; /** Resets the track to the starting position */ void Reset(); Matrix4x4 GetOrientation(); protected: VertexArray mVertices; /// current position between two verticess curve paramter float mT; /// the current vertex position int mCurrentVertexIdx; }; } #endif // __MOTIONPATH_H