Public Member Functions | |
void | SetAnimationPath (vtAnimPath *path) |
Set the animation path for this engine to use. | |
vtAnimPath * | GetAnimationPath () |
Get the animation path associated with this engine. | |
const vtAnimPath * | GetAnimationPath () const |
Get the animation path associated with this engine. | |
void | Reset () |
void | SetSpeed (float fSpeed) |
Set the play speed, in time units per second. Default is 1.0. | |
float | GetSpeed () const |
Get the play speed. | |
void | SetContinuous (bool bFlag) |
bool | GetContinuous () const |
Return true if set for continuous play. | |
void | SetPosOnly (bool bFlag) |
bool | GetPosOnly () const |
Return true if set to use position only. | |
virtual void | Eval () |
Virtual handler, will be called every frame to do the work of the engine. | |
void | SetTime (float fTime) |
float | GetTime () |
![]() | |
osg::Referenced * | GetTarget (uint which=0) |
void | AddTarget (osg::Referenced *ptr) |
void | RemoveTarget (osg::Referenced *ptr) |
uint | NumTargets () |
Return the number of targets for this engine. | |
virtual void | OnMouse (vtMouseEvent &event) |
Virtual handler, to catch mouse events, can be overridden by your engine class. | |
virtual void | OnKey (int key, int flags) |
Virtual handler, to catch keyboard events, can be overridden by your engine class. | |
virtual void | OnWindowSize (int width, int height) |
Virtual handler, to catch resize events, can be overridden by your engine class. | |
This class connects a path (vtAnimPath) to any number of targets. The targets can be any transform (such as scene graph object or camera) which will be moved along the path based on time.
Speed is relative. For example, calling SetSpeed(2.0) means that an animation path with control points from 0 to 10 seconds will be played in 5 seconds. Default speed is 1.0.
Other aspects of playback you can control include continuous play (SetContinuous) and position only (SetPosOnly) which is useful if you want to move a camera along a path but allow the user to freely look around.
|
inline |
Set the play time, which will be in the range of 0.0 to the length of the animation path.
void vtAnimPathEngine::Reset | ( | ) |
Set the engine back to the beginning of its path (time = 0). This will affect the targets the next time Eval() or UpdateTargets() is called.
|
inline |
Set to true for continuous play, meaning that each time it reaches the end of the animation path, it continues from the beginning without stopping.
|
inline |
Set to true for play to ignore the orientation of the animation path, so that only the position of the targets is affected.
|
inline |
Set the play time, which should be in the range of 0.0 to the length of the animation path. This will affect the targets the next time Eval() or UpdateTargets() is called.