43 VL_DEBUG_SET_OBJECT_NAME()
78 mAnim_t = (float)(ft * frame_count - (
int)(ft * frame_count));
79 mFrame1 = (int)(ft * frame_count);
128 #if 1 // faster method: 146 #else // slower but simpler method: 191 if (buffer && buffer->
objectName() ==
"vertex_frame")
196 if (buffer && buffer->
objectName() ==
"normal_frame")
204 Log::error(
"MorphingCallback::init(): no ArrayFloat3 named 'vertex_frame' found.\n");
210 Log::error(
"MorphingCallback::init(): no ArrayFloat3 named 'normal_frame' found.\n");
216 Log::error(
"MorphingCallback::init(): vertex frame count differs from normal frame count.\n");
244 float Ha = 2*t*t*t - 3*t*t + 1;
245 float Hb = -2*t*t*t + 3*t*t;
248 for(
size_t i=0; i<
mVertices->size(); ++i)
The ArrayAbstract class defines an abstract interface to conveniently manipulate data stored in a Buf...
Associates a Renderable object to an Effect and Transform.
void setAnimation(int start, int end, float period)
std::vector< ref< ArrayFloat3 > > mNormalFrames
int getUniformLocation(const char *name) const
Returns the binding index of the given uniform.
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...
static void error(const String &message)
Use this function to provide information about run-time errors: file not found, out of memory...
Wraps a GLSL program to which you can bind vertex, fragment and geometry shaders. ...
const Collection< ActorEventCallback > * actorEventCallbacks() const
Returns the list of ActorEventCallback bound to an Actor.
Data is specified many times and used many times as the source of drawing and image specification com...
ref< ArrayFloat3 > mNormals
size_t count() const
Don't use inside loops! Counts the number object of the specified type.
void init(ResourceDatabase *res_db)
Initializes a MorphingCallback from a ResourceDatabase.
The Geometry class is a Renderable that implements a polygonal mesh made of polygons, lines and points.
Visualization Library main namespace.
ref< Geometry > mGeometry
void blendFrames(int a, int b, float t)
void setGLSLVertexBlendEnabled(bool enable)
void get(std::vector< ref< T > > &resources, bool clear_vector=true)
Returns all the objects of the specified type in the given vector.
An abstract class that represents all the objects that can be rendered.
bool glslVertexBlendEnabled() const
std::vector< ref< ArrayFloat3 > > mVertexFrames
int getAttribLocation(const char *name) const
Eqivalento to glGetAttribLocation(handle(), name).
Manages most of the OpenGL rendering states responsible of the final aspect of the rendered objects...
ref< ArrayFloat3 > mVertices
Keeps the local buffer on RAM and updates the BufferObject only if it is marked as dirty...
const std::string & objectName() const
The name of the object, by default set to the object's class name.
void initFrom(MorphingCallback *morph_cb)
The MorphingCallback class implements a simple morphing animation mechanism using the GPU acceleratio...
void setLod(int lod_index, Renderable *renderable)
Sets the Renderable object representing the LOD level specifed by lod_index.
void startAnimation(real time=-1)
Represents a virtual camera defining, among other things, the point of view from which scenes can be ...
const GLSLProgram * glslProgram() const
Returns the GLSLProgram associated to a Shader (if any)
void bindActor(Actor *actor)
The ResourceDatabase class contains and manipulates a set of resources.