Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Public Attributes | List of all members
vtAnimPathEngine Class Reference

#include <AnimPath.h>

Inheritance diagram for vtAnimPathEngine:
vtEngine vtEnabledBase

Public Member Functions

 vtAnimPathEngine (vtAnimPath *ap)
 
void SetAnimationPath (vtAnimPath *path)
 Set the animation path for this engine to use.
 
vtAnimPathGetAnimationPath ()
 Get the animation path associated with this engine.
 
const vtAnimPathGetAnimationPath () const
 Get the animation path associated with this engine.
 
void UpdateTargets ()
 
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.
 
virtual void SetEnabled (bool bOn)
 
void SetTime (float fTime)
 
float GetTime ()
 
- Public Member Functions inherited from vtEngine
osg::Referenced * GetTarget (uint which=0)
 
void AddTarget (osg::Referenced *ptr)
 
void SetTarget (osg::Referenced *ptr)
 
void RemoveTarget (osg::Referenced *ptr)
 
uint NumTargets ()
 Return the number of targets for this engine.
 
void setName (const char *str)
 
const char * getName ()
 
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.
 
void SetWindow (vtWindow *pWin)
 
vtWindowGetWindow ()
 
void AddChild (vtEngine *pEngine)
 
void RemoveChild (vtEngine *pEngine)
 
vtEngineGetChild (uint i)
 
uint NumChildren ()
 
void AddChildrenToList (vtArray< vtEngine * > &list, bool bEnabledOnly)
 
- Public Member Functions inherited from vtEnabledBase
bool GetEnabled ()
 

Public Attributes

vtAnimPathPtr m_pAnimationPath
 
bool m_bContinuous
 
float m_fLastTime
 
float m_fTime
 
bool m_bPosOnly
 
float m_fSpeed
 

Additional Inherited Members

- Protected Attributes inherited from vtEngine
vtArray< osg::Referenced * > m_Targets
 
std::vector< vtEnginePtr > m_Children
 
vtString m_strName
 
vtWindowm_pWindow
 

Detailed Description

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.

Member Function Documentation

float vtAnimPathEngine::GetTime ( )
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.

void vtAnimPathEngine::SetContinuous ( bool  bFlag)
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.

void vtAnimPathEngine::SetPosOnly ( bool  bFlag)
inline

Set to true for play to ignore the orientation of the animation path, so that only the position of the targets is affected.

void vtAnimPathEngine::SetTime ( float  fTime)
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.


The documentation for this class was generated from the following files: