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:

vl::Actor vl::Object

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)
Geometrygeometry ()
const Geometrygeometry () const
bool animationStarted () const

Public Attributes

ref< GeometrymGeometry
ref< ArrayFVec3mVertices
ref< ArrayFVec3mNormals
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:

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

int vl::MorphingActor::mFrame1 [protected]

int vl::MorphingActor::mFrame2 [protected]

float vl::MorphingActor::mAnim_t [protected]


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

Visualization Library v2010.06 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Tue Jun 1 00:57:19 2010.
Permission is granted to use this page to write and publish articles regarding Visualization Library.