/*! * @file track.h */ #ifndef _TRACK_H_ #define _TRACK_H_ #include "curve.h" #include "base_object.h" // Forward Definition class PNode; class TiXmlElement; class ActionBox; class Track : public BaseObject { ObjectListDeclaration(Track); public: Track(); Track(const TiXmlElement* root); virtual ~Track(); virtual void loadParams(const TiXmlElement* root); void addPoint(float x, float y, float z); void addPointV(Vector newPoint); void setSpeed(float speed); void setMode(int newMode); void pauseTrack(bool stop); //void finalize(); inline Vector calcPos() const; inline Vector calcDir() const; void tick(float dt); PNode* getTrackNode(); void drawGraph(float dt = 0.01) const; //float startingTime; //!< The time at which this Track begins. float speed; float duration; //!< The time used to cross this Track (curve). float endTime; //!< The time at which this Track ends. float width; //!< The width of the action box, next to the player. float height; //!< The Height of the action box, next to the player float depth; //!< Depth of the action box float stretch; //!< multiplyer between w/h at player and w/h at far end of the action box int nodeCount; //!< The count of points this Track has. Curve* curve; //!< The Curve of this Track private: void init(); private: CurveType curveType; //!< The CurveType the entire TrackSystem will have. float localTime; //!< The time that has been passed since the traveling the Track. PNode* trackNode; //!< The node that is slave to the Track. This node will be moved while update the Track, and must NOT move itself. int mode; //!< Defines the behaviour of the Track. bool pause; //!< Defines if the track runs (false) or not (true) ActionBox* actionBox; void addActionBox( float width_2, float height_2, float depth, float stretch ); }; #endif /* _TRACK_H */