|
golib
0.5
|
#include <animation.h>
Public Member Functions | |
| Animation (const Animation &o) | |
| Animation & | operator= (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 Waypoint & | getWaypoint (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 . 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 goString & | getObjectName () 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... | |
Animation object.
Given a set of waypoints (or "keyframes"), interpolates between these points the translation and rotation on a curve interpolating these waypoints.
| void goGL::Animation::addWaypoint | ( | const Waypoint & | wp | ) |
Add a waypoint to the end of the waypoint list.
| wp | Waypoint to add. |
| bool goGL::Animation::getAutoTime | ( | ) | const |
| bool goGL::Animation::getConstantSpeedFromPosition | ( | ) | const |
Get the constant speed flag.
| goSize_t goGL::Animation::getSteps | ( | ) | const |
| const goGL::Waypoint & goGL::Animation::getWaypoint | ( | goIndex_t | i | ) | const |
Get a specific existing waypoint.
| i | Index of the waypoint. |
i. | const goList< goGL::Waypoint > & goGL::Animation::getWaypoints | ( | ) | const |
Get the list of waypoints.
| void goGL::Animation::initInterpolation | ( | ) |
Initialise the interpolation.
This gets automatically called by interpolate() if something changed.
| 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.
| i | Index |
| wp | New waypoint |
| void goGL::Animation::interpolate | ( | goDouble | t, |
| Waypoint & | ret | ||
| ) |
Interpolate a waypoint at time
.
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.
| t | Time in the interval [0,1]. |
| ret | The interpolated waypoint. |
|
virtual |
Read animation into this object from a file.
| f | File pointer to read from. |
| void goGL::Animation::removeWaypoint | ( | goIndex_t | i | ) |
Remove a specific waypoint.
| i | Index of the waypoint to remove. |
| 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.
| t | True of false. |
| 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.
true.| t | Flag, true or false. |
| void goGL::Animation::setSteps | ( | goSize_t | s | ) |
| s |
| void goGL::Animation::setWaypoint | ( | goIndex_t | i, |
| const goGL::Waypoint & | wp | ||
| ) |
Set a specific waypoint that already exists.
| i | Index of the waypoints. |
| wp | Waypoint to copy the data from. |
|
virtual |
Write this animation to a file.
| f | File pointer. |