14#ifndef OSG_ANIMATIONPATH
15#define OSG_ANIMATIONPATH 1
78 float one_minus_ratio = 1.0f-ratio;
86 double one_minus_ratio = 1.0-ratio;
202 void write(std::ostream& out)
const;
205 void write(TimeControlPointMap::const_iterator itr, std::ostream& out)
const;
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
AnimationPath encapsulates a time varying transformation pathway.
Definition AnimationPath:34
bool empty() const
Definition AnimationPath:194
virtual bool getInterpolatedControlPoint(double time, ControlPoint &controlPoint) const
Given a specific time, return the local ControlPoint frame for a point.
META_Object(osg, AnimationPath)
TimeControlPointMap _timeControlPointMap
Definition AnimationPath:211
void write(std::ostream &out) const
Write the animation path to a flat ASCII file stream.
std::map< double, ControlPoint > TimeControlPointMap
Definition AnimationPath:186
bool getMatrix(double time, Matrixf &matrix) const
Given a specific time, return the transformation matrix for a point.
Definition AnimationPath:130
bool getInverse(double time, Matrixf &matrix) const
Given a specific time, return the inverse transformation matrix for a point.
Definition AnimationPath:148
AnimationPath()
Definition AnimationPath:37
void setTimeControlPointMap(TimeControlPointMap &tcpm)
Definition AnimationPath:188
void clear()
Definition AnimationPath:196
const TimeControlPointMap & getTimeControlPointMap() const
Definition AnimationPath:192
void insert(double time, const ControlPoint &controlPoint)
Insert a control point into the AnimationPath.
bool getInverse(double time, Matrixd &matrix) const
Definition AnimationPath:156
void setLoopMode(LoopMode lm)
Definition AnimationPath:181
bool getMatrix(double time, Matrixd &matrix) const
Given a specific time, return the transformation matrix for a point.
Definition AnimationPath:139
void read(std::istream &in)
Read the animation path from a flat ASCII file stream.
LoopMode getLoopMode() const
Definition AnimationPath:183
LoopMode _loopMode
Definition AnimationPath:212
LoopMode
Definition AnimationPath:175
@ NO_LOOPING
Definition AnimationPath:178
@ SWING
Definition AnimationPath:176
@ LOOP
Definition AnimationPath:177
TimeControlPointMap & getTimeControlPointMap()
Definition AnimationPath:190
void write(TimeControlPointMap::const_iterator itr, std::ostream &out) const
Write the control point to a flat ASCII file stream.
virtual ~AnimationPath()
Definition AnimationPath:209
AnimationPath(const AnimationPath &ap, const CopyOp ©op=CopyOp::SHALLOW_COPY)
Definition AnimationPath:39
double getPeriod() const
Definition AnimationPath:172
double getFirstTime() const
Definition AnimationPath:170
double getLastTime() const
Definition AnimationPath:171
Definition AnimationPath:47
osg::Quat _rotation
Definition AnimationPath:123
osg::Vec3d _position
Definition AnimationPath:122
void interpolate(double ratio, const ControlPoint &first, const ControlPoint &second)
Definition AnimationPath:84
const osg::Vec3d & getScale() const
Definition AnimationPath:74
const osg::Vec3d & getPosition() const
Definition AnimationPath:68
ControlPoint(const osg::Vec3d &position, const osg::Quat &rotation)
Definition AnimationPath:57
osg::Vec3d _scale
Definition AnimationPath:124
void interpolate(float ratio, const ControlPoint &first, const ControlPoint &second)
Definition AnimationPath:76
void getInverse(Matrixf &matrix) const
Definition AnimationPath:106
void setRotation(const osg::Quat &rotation)
Definition AnimationPath:70
void getMatrix(Matrixf &matrix) const
Definition AnimationPath:92
void getInverse(Matrixd &matrix) const
Definition AnimationPath:113
void setScale(const osg::Vec3d &scale)
Definition AnimationPath:73
ControlPoint(const osg::Vec3d &position, const osg::Quat &rotation, const osg::Vec3d &scale)
Definition AnimationPath:62
ControlPoint()
Definition AnimationPath:49
const osg::Quat & getRotation() const
Definition AnimationPath:71
ControlPoint(const osg::Vec3d &position)
Definition AnimationPath:52
void getMatrix(Matrixd &matrix) const
Definition AnimationPath:99
void setPosition(const osg::Vec3d &position)
Definition AnimationPath:67
bool getUseInverseMatrix() const
Definition AnimationPath:272
void setPause(bool pause)
double _pauseTime
Definition AnimationPath:306
AnimationPath * getAnimationPath()
Definition AnimationPath:265
AnimationPathCallback()
Definition AnimationPath:221
double _latestTime
Definition AnimationPath:304
const AnimationPath * getAnimationPath() const
Definition AnimationPath:266
virtual double getAnimationTime() const
Get the animation time that is used to specify the position along the AnimationPath.
double _timeOffset
Definition AnimationPath:301
ref_ptr< AnimationPath > _animationPath
Definition AnimationPath:298
osg::Vec3d _pivotPoint
Definition AnimationPath:299
void setTimeOffset(double offset)
Definition AnimationPath:274
void setPivotPoint(const Vec3d &pivot)
Definition AnimationPath:268
AnimationPathCallback(const osg::Vec3d &pivot, const osg::Vec3d &axis, float angularVelocity)
Construct an AnimationPathCallback and automatically create an animation path to produce a rotation a...
bool getPause() const
Definition AnimationPath:284
bool _useInverseMatrix
Definition AnimationPath:300
void setAnimationPath(AnimationPath *path)
Definition AnimationPath:264
bool _pause
Definition AnimationPath:305
double getTimeMultiplier() const
Definition AnimationPath:278
AnimationPathCallback(AnimationPath *ap, double timeOffset=0.0, double timeMultiplier=1.0)
Construct an AnimationPathCallback with a specified animation path.
Definition AnimationPath:249
~AnimationPathCallback()
Definition AnimationPath:310
virtual void operator()(Node *node, NodeVisitor *nv)
Implements the callback.
double getTimeOffset() const
Definition AnimationPath:275
void update(osg::Node &node)
void setUseInverseMatrix(bool useInverseMatrix)
Definition AnimationPath:271
META_Object(osg, AnimationPathCallback)
double _firstTime
Definition AnimationPath:303
AnimationPathCallback(const AnimationPathCallback &apc, const CopyOp ©op)
Definition AnimationPath:231
const Vec3d & getPivotPoint() const
Definition AnimationPath:269
double _timeMultiplier
Definition AnimationPath:302
void setTimeMultiplier(double multiplier)
Definition AnimationPath:277
NodeCallback()
Definition Callback:219
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
void preMultScale(const Vec3d &v)
Optimized version of preMult(scale(v));.
Definition Matrixd:747
void postMultScale(const Vec3d &v)
Optimized version of postMult(scale(v));.
Definition Matrixd:761
void preMultTranslate(const Vec3d &v)
Optimized version of preMult(translate(v));.
Definition Matrixd:691
void postMultTranslate(const Vec3d &v)
Optimized version of postMult(translate(v));.
Definition Matrixd:719
void makeRotate(const Vec3f &from, const Vec3f &to)
void postMultTranslate(const Vec3d &v)
Optimized version of postMult(translate(v));.
Definition Matrixf:823
void preMultScale(const Vec3d &v)
Optimized version of preMult(scale(v));.
Definition Matrixf:851
void preMultTranslate(const Vec3d &v)
Optimized version of preMult(translate(v));.
Definition Matrixf:795
void makeRotate(const Vec3f &from, const Vec3f &to)
void postMultScale(const Vec3d &v)
Optimized version of postMult(scale(v));.
Definition Matrixf:865
Base class for all internal nodes in the scene graph.
Definition Node:72
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Object()
Construct an object.
Definition Object:69
A quaternion class.
Definition Quat:30
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
General purpose double triple for use as vertices, vectors and normals.
Definition Vec3d:30
#define OSG_EXPORT
Definition Export:39