afPathLinear.h
资源名称:AirForce.rar [点击查看]
上传用户:kaiguan
上传日期:2007-10-28
资源大小:1074k
文件大小:1k
源码类别:
其他游戏
开发平台:
Visual C++
- #ifndef AF_PATHLINEAR
- #define AF_PATHLINEAR
- #include "afPath.h"
- #include "afList.h"
- #include "afString.h"
- /// This class implements the basic afPath interface.
- /**
- * It provides a path contructed of linear subsection
- * (polyline). the rotation can be interpolated if requested.
- */
- class afPathLinear : public afPath
- {
- public:
- afPathLinear();
- /// Loads a path from the file
- /**
- * This method load a path from a file
- * Each line must contain three float values.
- * In order to support 3dsMAX the y & z values
- * are exchanged.
- */
- bool load(const char* nFileName);
- /// Enables interpolation of the rotation
- /**
- * Not implemented yet.
- */
- void setInterpolateRotation(bool nEnable) { interpolRot = nEnable; }
- /// Returns the number of corners, which build this linear path
- int getNumCorners() const { return posList.getSize(); }
- /// Returns a specific corner
- const afVec3& getCorner(int nIndex) const { return posList[nIndex]; }
- // implementation of afPath interface
- virtual afVec3 getPosition(float nPos);
- virtual afVec3n getDirection(float nPos);
- virtual int getPosDir(float nPos, afVec3& nPosition, afVec3n& nDirection);
- virtual float getLength() const { return lenList.getTail(); }
- private:
- afString name;
- bool interpolRot;
- afList<afVec3> posList;
- afList<float> lenList;
- };
- #endif