#include <sglTimedAnimation.hpp>
Inheritance diagram for sglTimedAnimation::
Public Methods | |
sglTimedAnimation () | |
virtual | ~sglTimedAnimation () |
virtual bool | addChild (sglNode *node) |
virtual bool | insertChild (unsigned int index, sglNode *node) |
virtual bool | removeChild (sglNode *node) |
virtual sglNode* | removeChild (unsigned int index) |
void | setOffsetTime (const sglTimespec &offset_time) |
const sglTimespec& | getOffsetTime () const |
bool | setDuration (sglNode *node, float sec) |
float | getDuration (sglNode *node) const |
bool | setDuration (unsigned int index, float sec) |
float | getDuration (unsigned int index) const |
virtual sglBound::IntersectResultEnum | intersect (sglIntersectf &isector) const |
virtual sglBound::IntersectResultEnum | intersect (sglIntersectd &isector) const |
virtual void | pick (sglPickf &pick_state, unsigned int cull_flags) const |
virtual void | pick (sglPickd &pick_state, unsigned int cull_flags) const |
virtual void | preDraw (const PreDrawStruct &trav_state) |
virtual sglNode* | clone (unsigned int mode) const |
virtual void | printInfo (ostream &ostrm, const char *indent_string) const |
Protected Methods | |
virtual void | cull (sglCull< float > &trav_state, unsigned int cull_flags) const |
virtual void | cull (sglCull< double > &trav_state, unsigned int cull_flags) const |
virtual void | computeValues () |
sglNode* | computeChild (double atime) const |
sglNode* | selectChild (const sglTimespec ¤t_time) const |
void | copyTo (sglTimedAnimation *dst, unsigned int mode) const |
Protected Attributes | |
vector<float> | m_durations |
sglTimespec | m_start_time |
sglTimespec | m_pause_time |
sglTimespec | m_offset_time |
double | m_pause_diff |
float | m_total_time |
float | m_total_time2 |
float | m_forward_time |
float | m_return_time |
Example:
sglTimedAnimation *animation = new sglTimedAnimation; for (unsigned int ix=0; ix<10; ++ix) { sglGeode *geode = new sglGeode; animation->addChild(geode); animation->setDuration(ix, 0.6f); // display for 0.6 seconds } animation->setMode(sglAnimation::eCYCLE); // forward only animation->setRange(); // display all animation->setSpeed(0.75f); // .75 of normal speed // (0.8 seconds each) animation->setNumCycles(1); // one-shot // set the animation to start on the next frame (after preDraw()). animation->setState(sglAnimation::eSTART);
Definition at line 67 of file sglTimedAnimation.hpp.
|
default constructor.
|
|
virtual destructor.
|
|
Add child to the end of the list.
Reimplemented from sglGroup. |
|
Insert a child at a specific index. Valid indices are in the range [0,getNumChildren()].
Reimplemented from sglGroup. |
|
Remove the last instance of the child from the list
Reimplemented from sglGroup. |
|
Removes child at position index (valid indices: [0,getNumChildren()-1]). Nodes after this in the list then shift down one index.
Reimplemented from sglGroup. |
|
Set an offset time when starting the animation. Only positive times are allowed, which will start the animation further forward into the sequence. This will only take effect the next time the state is changed to START.
|
|
Query the current time offset.
Definition at line 93 of file sglTimedAnimation.hpp. |
|
Sets the duration, in number of seconds, of the first child in the list that matches the pointer.
|
|
Gets the current duration of the child specified by the node pointer.
|
|
Sets the duration, in number of seconds, of the child specified by the index.
|
|
Gets the current duration of the child corresponding to the index.
|
|
The single precision intersection traversal function which returns the closest object (bounding volume and/or triangle) that intersects with the given intersect segment.
Reimplemented from sglGroup. |
|
The double precision intersection traversal function which returns the closest object (bounding volume and/or triangle) that intersects with the given intersect segment.
Reimplemented from sglGroup. |
|
The single precision pick traversal function which returns all objects that fall within the pick frustum.
Reimplemented from sglGroup. |
|
The double precision pick traversal function which returns all objects that fall within the pick frustum.
Reimplemented from sglGroup. |
|
This is the pre-draw traversal function which should be called before intersecting or culling the scene graph. This "cleans" the tree by computing the bound boxes and spheres that have been marked as dirty, building display lists for geometry that has changed, binding textures that need to be, updating the animation nodes whose state has changed. This should be called with a valid graphics context current.
Reimplemented from sglGroup. |
|
Make a copy of the scenegraph rooted at this node.
Reimplemented from sglGroup. |
|
Output the state of this node to the specified ostream.
Reimplemented from sglAnimation. |
|
The single precision cull traversal function that culls out subgraphs that do not lie in the view frustum (stored in the sglCull parameter). Subclasses must implement this function. The entry point for user-friendly culling is in the sglScene class.
Reimplemented from sglGroup. |
|
The double precision cull traversal function that culls out subgraphs that do not lie in the view frustum (stored in the sglCull parameter). Subclasses must implement this function. The entry point for user-friendly culling is in the sglScene class.
Reimplemented from sglGroup. |