golib  0.5
goGL::Animation Class Reference

Animation object. More...

#include <animation.h>

Public Member Functions

 Animation (const Animation &o)
 
Animationoperator= (const Animation &o)
 
void setSteps (goSize_t s)
 
goSize_t getSteps () const
 
const goList< Waypoint > & getWaypoints () const
 Get the list of waypoints. More...
 
void addWaypoint (const Waypoint &wp)
 Add a waypoint to the end of the waypoint list. More...
 
const WaypointgetWaypoint (goIndex_t i) const
 Get a specific existing waypoint. More...
 
void setWaypoint (goIndex_t i, const goGL::Waypoint &wp)
 Set a specific waypoint that already exists. More...
 
void insertWaypoint (goIndex_t i, const goGL::Waypoint &wp)
 Prepends wp before waypoint i. More...
 
void removeWaypoint (goIndex_t i)
 Remove a specific waypoint. More...
 
void setConstantSpeedFromPosition (bool t)
 Set how to calculate the point in time for each waypoint. More...
 
bool getConstantSpeedFromPosition () const
 Get the constant speed flag. More...
 
void setAutoTime (bool t)
 Set whether to fill time points when initialising. More...
 
bool getAutoTime () const
 Get the auto time flag. More...
 
virtual bool writeASCII (FILE *f) const
 Write this animation to a file. More...
 
virtual bool readASCII (FILE *f)
 Read animation into this object from a file. More...
 
virtual bool writeASCII (const char *filename) const
 
virtual bool readASCII (const char *filename)
 
void initInterpolation ()
 Initialise the interpolation. More...
 
void interpolate (goDouble t, Waypoint &ret)
 Interpolate a waypoint at time $ t \in [0,1] $. More...
 
- Public Member Functions inherited from goObjectBase
 goObjectBase ()
 Constructor.
 
virtual ~goObjectBase ()
 Destructor. More...
 
const char * getClassName () const
 Returns the class name. More...
 
int getClassID () const
 
virtual goSize_t memoryUsage () const
 Returns the size of this object or some measure of its memory consumption. More...
 
void setObjectName (const char *name)
 Set name string for an object. More...
 
void setObjectName (const goString &name)
 Set name string for an object. More...
 
const goStringgetObjectName () const
 Get the object name. More...
 
virtual bool writeObjectFile (FILE *) const
 Write object to a file. More...
 
virtual bool readObjectFile (FILE *)
 Read object from a file. More...
 
void connectObject (goObjectBase *object)
 Connects an object to this object. More...
 
void disconnectObject (const goObjectBase *object)
 Disconnects an object from this object.
 
virtual bool callObjectMethod (int methodID, goObjectMethodParameters *param=NULL)
 Call an object method by identifier. More...
 
virtual bool queueObjectMethod (int methodID, goObjectMethodParameters *param=NULL, bool blocking=false)
 Enqueue a method call to an internal list of methods. More...
 
bool callQueuedMethods ()
 Call all queued methods. More...
 

Additional Inherited Members

- Protected Member Functions inherited from goObjectBase
void setClassID (int id)
 Sets the class name.
 
void printClassMessage (const char *msg)
 Sets the class name. More...
 
void printClassMessage (goString &msg)
 Prints an informational message to the calling console. More...
 
void sendObjectMessage (int messageID, void *data=NULL)
 Sends a message to all connected objects.
 
void sendObjectMessage (goObjectBase *object, int messageID, void *data=NULL)
 Sends a message to a specific object.
 
virtual void receiveObjectMessage (const goObjectMessage &message)
 Receive a message. More...
 

Detailed Description

Animation object.

Given a set of waypoints (or "keyframes"), interpolates between these points the translation and rotation on a curve interpolating these waypoints.

Member Function Documentation

◆ addWaypoint()

void goGL::Animation::addWaypoint ( const Waypoint wp)

Add a waypoint to the end of the waypoint list.

Parameters
wpWaypoint to add.

◆ getAutoTime()

bool goGL::Animation::getAutoTime ( ) const

Get the auto time flag.

@seet setAutoTime()

Returns
The auto time flag.

◆ getConstantSpeedFromPosition()

bool goGL::Animation::getConstantSpeedFromPosition ( ) const

Get the constant speed flag.

See also
setConstantSpeedFromPosition().
Returns
The constant speed flag.

◆ getSteps()

goSize_t goGL::Animation::getSteps ( ) const
Deprecated:
Returns

◆ getWaypoint()

const goGL::Waypoint & goGL::Animation::getWaypoint ( goIndex_t  i) const

Get a specific existing waypoint.

Parameters
iIndex of the waypoint.
Returns
The waypoint number i.

◆ getWaypoints()

const goList< goGL::Waypoint > & goGL::Animation::getWaypoints ( ) const

Get the list of waypoints.

Returns
The list of waypoints.

◆ initInterpolation()

void goGL::Animation::initInterpolation ( )

Initialise the interpolation.

This gets automatically called by interpolate() if something changed.

◆ insertWaypoint()

void goGL::Animation::insertWaypoint ( goIndex_t  i,
const goGL::Waypoint wp 
)

Prepends wp before waypoint i.

If i is larger than the highest index, wp gets appended.

Parameters
iIndex
wpNew waypoint

◆ interpolate()

void goGL::Animation::interpolate ( goDouble  t,
Waypoint ret 
)

Interpolate a waypoint at time $ t \in [0,1] $.

Currently, the translation of the waypoint is interpolated using cubic splines, and the rotation is interpolated by linear interpolation on the space of rotations SO3.

Parameters
tTime in the interval [0,1].
retThe interpolated waypoint.

◆ readASCII()

bool goGL::Animation::readASCII ( FILE *  f)
virtual

Read animation into this object from a file.

Parameters
fFile pointer to read from.
Returns
True if successful, false otherwise.

◆ removeWaypoint()

void goGL::Animation::removeWaypoint ( goIndex_t  i)

Remove a specific waypoint.

Parameters
iIndex of the waypoint to remove.

◆ setAutoTime()

void goGL::Animation::setAutoTime ( bool  t)

Set whether to fill time points when initialising.

If set to true (default), initInterpolation() will fill the time of each waypoint, uniformly filling the time between 0 and 1.

If set to false, the times are untouched.

Parameters
tTrue of false.

◆ setConstantSpeedFromPosition()

void goGL::Animation::setConstantSpeedFromPosition ( bool  t)

Set how to calculate the point in time for each waypoint.

If set to true, the time for each waypoint is calculated from its translation, to yield a roughly constant speed. If set to false, the time points set in the waypoints themselves are used.

Note
No subsequent positions may be equal if this is set to true. Set to false if you want to interpolate e.g. only rotations. The default for this property is true.
Parameters
tFlag, true or false.

◆ setSteps()

void goGL::Animation::setSteps ( goSize_t  s)
Deprecated:
Parameters
s

◆ setWaypoint()

void goGL::Animation::setWaypoint ( goIndex_t  i,
const goGL::Waypoint wp 
)

Set a specific waypoint that already exists.

Parameters
iIndex of the waypoints.
wpWaypoint to copy the data from.

◆ writeASCII()

bool goGL::Animation::writeASCII ( FILE *  f) const
virtual

Write this animation to a file.

Parameters
fFile pointer.
Returns
True if successful, false otherwise.

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