Added new osganimate demo which demonstrate the osg::AnimationPath in action.

Added extra parameters to the AnimationPath callbacks to allow finer control.
This commit is contained in:
Robert Osfield
2002-10-07 19:51:11 +00:00
parent 478f736f63
commit b7372fb4cb
12 changed files with 415 additions and 7 deletions

View File

@@ -85,14 +85,18 @@ class SG_EXPORT MatrixTransform : public Transform
{
public:
AnimationPathCallback(AnimationPath* ap):
AnimationPathCallback(AnimationPath* ap,double timeOffset=0.0f,double timeMultiplier=1.0f):
_animationPath(ap),
_timeOffset(timeOffset),
_timeMultiplier(timeMultiplier),
_firstTime(0.0) {}
/** implements the callback*/
virtual void operator()(Node* node, NodeVisitor* nv);
ref_ptr<AnimationPath> _animationPath;
double _timeOffset;
double _timeMultiplier;
double _firstTime;
};

View File

@@ -57,14 +57,18 @@ class SG_EXPORT PositionAttitudeTransform : public Transform
{
public:
AnimationPathCallback(AnimationPath* ap):
AnimationPathCallback(AnimationPath* ap,double timeOffset=0.0f,double timeMultiplier=1.0f):
_animationPath(ap),
_timeOffset(timeOffset),
_timeMultiplier(timeMultiplier),
_firstTime(0.0) {}
/** implements the callback*/
virtual void operator()(Node* node, NodeVisitor* nv);
ref_ptr<AnimationPath> _animationPath;
double _timeOffset;
double _timeMultiplier;
double _firstTime;
};

View File

@@ -29,9 +29,21 @@ class SG_EXPORT Quat
---------------------------------------------------------- */
Vec4 _fv; // a four-vector
Quat(): _fv(0.0f,0.0f,0.0f,1.0f) {}
Quat( float x, float y, float z, float w ): _fv(x,y,z,w) {}
Quat( const Vec4& v ): _fv(v) {}
inline Quat(): _fv(0.0f,0.0f,0.0f,1.0f) {}
inline Quat( float x, float y, float z, float w ): _fv(x,y,z,w) {}
inline Quat( const Vec4& v ): _fv(v) {}
inline Quat( float angle, const Vec3& axis)
{
makeRotate(angle,axis);
}
inline Quat( float angle1, const Vec3& axis1,
float angle2, const Vec3& axis2,
float angle3, const Vec3& axis3)
{
makeRotate(angle1,axis1,angle2,axis2,angle3,axis3);
}
/* ----------------------------------
Methods to access data members