Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
The MorphingCallback class implements a simple morphing animation mechanism using the GPU acceleration where available. More...
#include <MorphingCallback.hpp>
Public Member Functions | |
| virtual const char * | className () |
| Returns the name of the class. | |
| MorphingCallback () | |
| ~MorphingCallback () | |
| virtual void | onActorRenderStarted (Actor *actor, Real frame_clock, const Camera *cam, Renderable *renderable, const Shader *, int pass) |
| Event generated just before an Actor is rendered but after the render states are ready and setup. | |
| virtual void | onActorDelete (Actor *) |
| Event notifying that an Actor is being deleted. | |
| void | bindActor (Actor *actor) |
| void | init (ResourceDatabase *res_db) |
| Initializes a MorphingCallback from a ResourceDatabase. | |
| void | blendFrames (int a, int b, float t) |
| void | setAnimation (int start, int end, float period) |
| void | startAnimation (Real time=-1) |
| void | stopAnimation () |
| void | initFrom (MorphingCallback *morph_cb) |
| void | resetGLSLBindings () |
| bool | glslVertexBlendEnabled () const |
| void | setGLSLVertexBlendEnabled (bool enable) |
| Geometry * | geometry () |
| const Geometry * | geometry () const |
| bool | animationStarted () const |
Protected Attributes | |
| ref< Geometry > | mGeometry |
| ref< ArrayFVec3 > | mVertices |
| ref< ArrayFVec3 > | mNormals |
| std::vector< ref< ArrayFVec3 > > | mVertexFrames |
| std::vector< ref< ArrayFVec3 > > | mNormalFrames |
| Real | mLastUpdate |
| Real | mElapsedTime |
| Real | mAnimationStartTime |
| int | mAnimationStart |
| int | mAnimationEnd |
| float | mAnimationPeriod |
| bool | mAnimationStarted |
| int | mFrame1 |
| int | mFrame2 |
| bool | mGLSLVertexBlendEnabled |
| int | mVertex2_Binding |
| int | mNormal2_Binding |
| int | mAnim_t_Binding |
| float | mAnim_t |
The MorphingCallback class implements a simple morphing animation mechanism using the GPU acceleration where available.
| MorphingCallback::MorphingCallback | ( | ) |
| MorphingCallback::~MorphingCallback | ( | ) |
| virtual const char* vl::MorphingCallback::className | ( | ) | [inline, virtual] |
Returns the name of the class.
Reimplemented from vl::Object.
| void MorphingCallback::onActorRenderStarted | ( | Actor * | actor, |
| Real | frame_clock, | ||
| const Camera * | cam, | ||
| Renderable * | renderable, | ||
| const Shader * | shader, | ||
| int | pass | ||
| ) | [virtual] |
Event generated just before an Actor is rendered but after the render states are ready and setup.
Reimplement to react to this event.
| actor | The Actor bound to this rendering callback. |
| frame_clock | The current rendering frame time, usually used for animation purposes. |
| cam | The camera used for the current rendering. |
| renderable | The currently selected Actor LOD. |
| shader | The currently active Shader. |
| pass | The current Actor[s] rendering pass. |
Implements vl::ActorEventCallback.
| virtual void vl::MorphingCallback::onActorDelete | ( | Actor * | actor ) | [inline, virtual] |
Event notifying that an Actor is being deleted.
Implements vl::ActorEventCallback.
| void MorphingCallback::bindActor | ( | Actor * | actor ) |
| void MorphingCallback::init | ( | ResourceDatabase * | res_db ) |
Initializes a MorphingCallback from a ResourceDatabase.
The given ResourceDatabase must contain a Geometry with all the desired DrawCalls and vertex attributes setup with the exception of the vertex position array and vertex normal array since they are automatically generated in realtime time during the rendering from the vertex and normal frames specified below. In addition ResourceDatabase must contain:
| void MorphingCallback::blendFrames | ( | int | a, |
| int | b, | ||
| float | t | ||
| ) |
| void MorphingCallback::setAnimation | ( | int | start, |
| int | end, | ||
| float | period | ||
| ) |
| void MorphingCallback::startAnimation | ( | Real | time = -1 ) |
| void MorphingCallback::stopAnimation | ( | ) |
| void MorphingCallback::initFrom | ( | MorphingCallback * | morph_cb ) |
| void MorphingCallback::resetGLSLBindings | ( | ) |
| bool vl::MorphingCallback::glslVertexBlendEnabled | ( | ) | const [inline] |
| void vl::MorphingCallback::setGLSLVertexBlendEnabled | ( | bool | enable ) | [inline] |
| Geometry* vl::MorphingCallback::geometry | ( | ) | [inline] |
| const Geometry* vl::MorphingCallback::geometry | ( | ) | const [inline] |
| bool vl::MorphingCallback::animationStarted | ( | ) | const [inline] |
ref<Geometry> vl::MorphingCallback::mGeometry [protected] |
ref<ArrayFVec3> vl::MorphingCallback::mVertices [protected] |
ref<ArrayFVec3> vl::MorphingCallback::mNormals [protected] |
std::vector< ref<ArrayFVec3> > vl::MorphingCallback::mVertexFrames [protected] |
std::vector< ref<ArrayFVec3> > vl::MorphingCallback::mNormalFrames [protected] |
Real vl::MorphingCallback::mLastUpdate [protected] |
Real vl::MorphingCallback::mElapsedTime [protected] |
Real vl::MorphingCallback::mAnimationStartTime [protected] |
int vl::MorphingCallback::mAnimationStart [protected] |
int vl::MorphingCallback::mAnimationEnd [protected] |
float vl::MorphingCallback::mAnimationPeriod [protected] |
bool vl::MorphingCallback::mAnimationStarted [protected] |
int vl::MorphingCallback::mFrame1 [protected] |
int vl::MorphingCallback::mFrame2 [protected] |
bool vl::MorphingCallback::mGLSLVertexBlendEnabled [protected] |
int vl::MorphingCallback::mVertex2_Binding [protected] |
int vl::MorphingCallback::mNormal2_Binding [protected] |
int vl::MorphingCallback::mAnim_t_Binding [protected] |
float vl::MorphingCallback::mAnim_t [protected] |