# Visualization Library A lightweight C++ OpenGL middleware for 2D/3D graphics | [Home] [Tutorials] [All Classes] [Grouped Classes]

# vl::MorphingActor Class Reference

The MorphingActor class animates a Geometry by interpolating its position and normal array. More...

`#include <MorphingActor.hpp>`

Inheritance diagram for vl::MorphingActor:

List of all members.

## Public Member Functions
virtual const char * | className ()
| Returns the name of the class.
| MorphingActor ()
void | init (ResourceDatabase *res_db)
| Initializes a MorphingActor from a ResourceDatabase.
void | blendFrames (int a, int b, float t)
virtual void | update (int lod, Camera *, Real delta_t)
| Virtual function used to update or animate an Actor during the rendering.
void | setAnimation (int start, int end, float period)
void | startAnimation (Real time=-1)
void | stopAnimation ()
void | initFrom (MorphingActor *morph_act)
void | resetGLSLBindings ()
bool | glslVertexBlendEnabled () const
void | setGLSLVertexBlendEnabled (bool enable)
Geometry * | geometry ()
const Geometry * | geometry () const
bool | animationStarted () const
## Public Attributes
ref< Geometry > | mGeometry
ref< ArrayFVec3 > | mVertices
ref< ArrayFVec3 > | mNormals
std::vector< ref< ArrayFVec3 > > | mVertexFrames
std::vector< ref< ArrayFVec3 > > | mNormalFrames
## Protected Attributes
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
## Friends
class | MorphingCallback

## Detailed Description

The MorphingActor class animates a Geometry by interpolating its position and normal array.

## Constructor & Destructor Documentation

MorphingActor::MorphingActor | ( |  | ) |

## Member Function Documentation

virtual const char* vl::MorphingActor::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Actor.

void MorphingActor::init | ( | ResourceDatabase * | res_db | ) |

Initializes a MorphingActor 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:

- N ArrayFVec3 objects named 'vertex_frame' containing the vertex position for every frame
- N ArrayFVec3 objects named 'normal_frame' containing the vertex normal for every frame where N is the number of animation frames.

void MorphingActor::blendFrames | ( | int | a,
|  | int | b,
|  | float | t |
| ) |  |  |

void MorphingActor::update | ( | int | ,
|  | Camera * | ,
|  | Real |  |
| ) |  |  | `[virtual]`

Virtual function used to update or animate an Actor during the rendering.

Parameters:

  | lod | the LOD (level of detail) currently selected for the rendering.
  | camera | the camera used for the current rendering.
  | cur_t | the current animation time.

Note:
  - is called after the actor resulted to be visible
  - is called only once per frame
  - is called before setting up the rendering states

See also:
  - ActorRenderingCallback
  - renderingCallbacks()

Reimplemented from vl::Actor.

void MorphingActor::setAnimation | ( | int | start,
|  | int | end,
|  | float | period |
| ) |  |  |

void MorphingActor::startAnimation | ( | Real | time = `-1` | ) |

void MorphingActor::stopAnimation | ( |  | ) |

void MorphingActor::initFrom | ( | MorphingActor * | morph_act | ) |

void MorphingActor::resetGLSLBindings | ( |  | ) |

bool vl::MorphingActor::glslVertexBlendEnabled | ( |  | ) | const`[inline]`

void vl::MorphingActor::setGLSLVertexBlendEnabled | ( | bool | enable | ) | `[inline]`

Geometry* vl::MorphingActor::geometry | ( |  | ) | `[inline]`

const Geometry* vl::MorphingActor::geometry | ( |  | ) | const`[inline]`

bool vl::MorphingActor::animationStarted | ( |  | ) | const`[inline]`

## Friends And Related Function Documentation

friend class MorphingCallback`[friend]`

## Member Data Documentation

ref<Geometry> vl::MorphingActor::mGeometry

ref<ArrayFVec3> vl::MorphingActor::mVertices

ref<ArrayFVec3> vl::MorphingActor::mNormals

std::vector< ref<ArrayFVec3> > vl::MorphingActor::mVertexFrames

std::vector< ref<ArrayFVec3> > vl::MorphingActor::mNormalFrames

Real vl::MorphingActor::mLastUpdate`[protected]`

Real vl::MorphingActor::mElapsedTime`[protected]`

Real vl::MorphingActor::mAnimationStartTime`[protected]`

int vl::MorphingActor::mAnimationStart`[protected]`

int vl::MorphingActor::mAnimationEnd`[protected]`

float vl::MorphingActor::mAnimationPeriod`[protected]`

bool vl::MorphingActor::mAnimationStarted`[protected]`

int vl::MorphingActor::mFrame1`[protected]`

int vl::MorphingActor::mFrame2`[protected]`

bool vl::MorphingActor::mGLSLVertexBlendEnabled`[protected]`

int vl::MorphingActor::mVertex2_Binding`[protected]`

int vl::MorphingActor::mNormal2_Binding`[protected]`

int vl::MorphingActor::mAnim_t_Binding`[protected]`

float vl::MorphingActor::mAnim_t`[protected]`

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

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/MorphingActor.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/MorphingActor.cpp

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Sun Nov 8 14:29:00 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.