/*! \file animation3d.h */ #include "animation.h" #include "vector.h" class PNode; //! KeyFrame3D Struct /** This represents one point with direction of the animation */ typedef struct KeyFrame3D { float duration; //!< The duration of this KeyFrame Vector position; //!< The position of this KeyFrame Quaternion direction; //!< The direction of this KeyFrame ANIM_FUNCTION animFunc; //!< with whitch function to iterate to the next KeyFrame3D }; //! Animation Struct /** This represents an animation for a object */ class Animation3D : public Animation { public: Animation3D(PNode* object); virtual ~Animation3D(void); virtual void rewind(void); void addKeyFrame(Vector position, Quaternion direction, float time, ANIM_FUNCTION animFunc = ANIM_LINEAR); // void addKeyFrame(KeyFrame3D* frame); virtual void tick(float dt); private: // animation functions void setAnimFunc(ANIM_FUNCTION animFunc); void constant(float timePassed) const; void linear(float timePassed) const; void sine(float timePassed) const; void cosine(float timePassed) const; void exp(float timePassed) const; void negExp(float timePassed) const; void quadratic(float timePassed) const; void random(float timePassed) const; // ANIM_FUNCTION animFunc; void (Animation3D::*animFunc)(float) const; //!< A Function for the AnimationType KeyFrame3D* currentKeyFrame; //!< The current KeyFrame KeyFrame3D* nextKeyFrame; //!< The KeyFrame we iterate to tList* keyFrameList; //!< The KeyFrameList // more class-local description PNode* object; //!< The Object from which to Animate something Vector lastPosition; //!< ?? Vector tmpVect; //!< what for?? float deltaT; //!< ?? };