afPath.h
资源名称:AirForce.rar [点击查看]
上传用户:kaiguan
上传日期:2007-10-28
资源大小:1074k
文件大小:1k
源码类别:
其他游戏
开发平台:
Visual C++
- #ifndef AF_PATH
- #define AF_PATH
- #include "afVec3n.h"
- /// This class defines the basic path interface which all path classes have to implement.
- /**
- * Some of the get-methods are not constant, since
- * a path might want to cache request data
- * (section of last request, etc...)
- */
- class afPath
- {
- public:
- /// Types of paths
- enum TYPE {
- TYPE_NONE, /**< Undefined Path Type */
- TYPE_LINEAR /**< Linear Path */
- };
- /// Returns the interpolated position on the path
- /**
- * nPos must be in range [0.0-1.0]
- */
- virtual afVec3 getPosition(float nPos) = 0;
- /// Returns the interpolated rotation on the path
- /**
- * nPos must be in range [0.0-1.0]
- */
- virtual afVec3n getDirection(float nPos) = 0;
- /// Returns the interpolated position and rotation
- /**
- * This method is far more efficient than calling
- * getPosition() and getRotation() seperately
- * nPos must be in range [0.0-1.0]
- * Returns the index of the base vertex used
- */
- virtual int getPosDir(float nPos, afVec3& nPosition, afVec3n& nDirection) = 0;
- /// Returns the type of the path
- virtual TYPE getType() const { return type; }
- /// Returns the length of the path
- virtual float getLength() const = 0;
- protected:
- TYPE type;
- };
- typedef afPath* afPathPtr;
- #endif