Irrlicht 3D Engine
IAnimatedMeshSceneNode.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__
6 #define __I_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__
7 
8 #include "ISceneNode.h"
9 #include "IBoneSceneNode.h"
10 #include "IAnimatedMeshMD2.h"
11 #include "IAnimatedMeshMD3.h"
12 
13 namespace irr
14 {
15 namespace scene
16 {
17  class IShadowVolumeSceneNode;
18 
20  {
23 
26 
29  };
30 
31 
32  class IAnimatedMeshSceneNode;
33 
35 
40  {
41  public:
42 
44 
47  virtual void OnAnimationEnd(IAnimatedMeshSceneNode* node) = 0;
48  };
49 
51 
54  {
55  public:
56 
59  const core::vector3df& position = core::vector3df(0,0,0),
60  const core::vector3df& rotation = core::vector3df(0,0,0),
61  const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
62  : ISceneNode(parent, mgr, id, position, rotation, scale) {}
63 
66 
68 
72  virtual void setCurrentFrame(f32 frame) = 0;
73 
75 
83  virtual bool setFrameLoop(s32 begin, s32 end) = 0;
84 
86 
87  virtual void setAnimationSpeed(f32 framesPerSecond) = 0;
88 
90 
91  virtual f32 getAnimationSpeed() const =0;
92 
94 
111  virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh=0,
112  s32 id=-1, bool zfailmethod=true, f32 infinity=1000.0f) = 0;
113 
114 
116 
130  virtual IBoneSceneNode* getJointNode(const c8* jointName)=0;
131 
133  virtual IBoneSceneNode* getJointNode(u32 jointID) = 0;
134 
136 
137  virtual u32 getJointCount() const = 0;
138 
140 
147  virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim) = 0;
148 
150 
162  virtual bool setMD2Animation(const c8* animationName) = 0;
163 
165  virtual f32 getFrameNr() const = 0;
167  virtual s32 getStartFrame() const = 0;
169  virtual s32 getEndFrame() const = 0;
170 
172 
173  virtual void setLoopMode(bool playAnimationLooped) = 0;
174 
176 
177  virtual bool getLoopMode() const = 0;
178 
180 
183  virtual void setAnimationEndCallback(IAnimationEndCallBack* callback=0) = 0;
184 
186 
189  virtual void setReadOnlyMaterials(bool readonly) = 0;
190 
192  virtual bool isReadOnlyMaterials() const = 0;
193 
195  virtual void setMesh(IAnimatedMesh* mesh) = 0;
196 
198  virtual IAnimatedMesh* getMesh(void) = 0;
199 
201  virtual const SMD3QuaternionTag* getMD3TagTransformation( const core::stringc & tagname) = 0;
202 
204  virtual void setJointMode(E_JOINT_UPDATE_ON_RENDER mode)=0;
205 
207 
210  virtual void setTransitionTime(f32 Time) =0;
211 
213 
214  virtual void animateJoints(bool CalculateAbsolutePositions=true) = 0;
215 
217 
218  virtual void setRenderFromIdentity( bool On )=0;
219 
221 
224  virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) = 0;
225 
226  };
227 
228 } // end namespace scene
229 } // end namespace irr
230 
231 #endif
232 
virtual void setAnimationEndCallback(IAnimationEndCallBack *callback=0)=0
Sets a callback interface which will be called if an animation playback has ended.
virtual u32 getJointCount() const =0
Gets joint count.
virtual void setRenderFromIdentity(bool On)=0
render mesh ignoring its transformation.
virtual void setJointMode(E_JOINT_UPDATE_ON_RENDER mode)=0
Set how the joints should be updated on render.
virtual void setLoopMode(bool playAnimationLooped)=0
Sets looping mode which is on by default.
float f32
32 bit floating point variable.
Definition: irrTypes.h:108
Scene node for rendering a shadow volume into a stencil buffer.
char c8
8 bit character variable.
Definition: irrTypes.h:35
Scene node interface.
Definition: ISceneNode.h:40
virtual void setReadOnlyMaterials(bool readonly)=0
Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
virtual void OnAnimationEnd(IAnimatedMeshSceneNode *node)=0
Will be called when the animation playback has ended.
Everything in the Irrlicht Engine can be found in this namespace.
Definition: aabbox3d.h:12
hold a tag info for connecting meshes
Very simple string class with some useful features.
Definition: irrString.h:37
Interface for bones used for skeletal animation.
Class which holds the geometry of an object.
Definition: IMesh.h:71
IAnimatedMeshSceneNode(ISceneNode *parent, ISceneManager *mgr, s32 id, const core::vector3df &position=core::vector3df(0, 0, 0), const core::vector3df &rotation=core::vector3df(0, 0, 0), const core::vector3df &scale=core::vector3df(1.0f, 1.0f, 1.0f))
Constructor.
virtual ISceneNode * clone(ISceneNode *newParent=0, ISceneManager *newManager=0)=0
Creates a clone of this scene node and its children.
virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim)=0
Starts a default MD2 animation.
EMD2_ANIMATION_TYPE
Types of standard md2 animations.
virtual void setTransitionTime(f32 Time)=0
Sets the transition time in seconds.
virtual s32 getStartFrame() const =0
Returns the current start frame number.
virtual IBoneSceneNode * getJointNode(const c8 *jointName)=0
Get a pointer to a joint in the mesh (if the mesh is a bone based mesh).
signed int s32
32 bit signed variable.
Definition: irrTypes.h:70
Scene node capable of displaying an animated mesh and its shadow.
virtual bool getLoopMode() const =0
returns the current loop mode
virtual f32 getAnimationSpeed() const =0
Gets the speed with which the animation is played.
virtual void animateJoints(bool CalculateAbsolutePositions=true)=0
animates the joints in the mesh based on the current frame.
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
virtual bool isReadOnlyMaterials() const =0
Returns if the scene node should not copy the materials of the mesh but use them in a read only style...
virtual IAnimatedMesh * getMesh(void)=0
Returns the current mesh.
virtual bool setFrameLoop(s32 begin, s32 end)=0
Sets the frame numbers between the animation is looped.
Callback interface for catching events of ended animations.
virtual const SMD3QuaternionTag * getMD3TagTransformation(const core::stringc &tagname)=0
Get the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh, or the absolutetrans...
get joints positions from the mesh (for attached nodes, etc)
The Scene Manager manages scene nodes, mesh resources, cameras and all the other stuff.
virtual void setAnimationSpeed(f32 framesPerSecond)=0
Sets the speed with which the animation is played.
virtual f32 getFrameNr() const =0
Returns the currently displayed frame number.
Base class of most objects of the Irrlicht Engine.
virtual void setCurrentFrame(f32 frame)=0
Sets the current frame number.
virtual void setMesh(IAnimatedMesh *mesh)=0
Sets a new mesh.
virtual s32 getEndFrame() const =0
Returns the current end frame number.
Interface for an animated mesh.
Definition: IAnimatedMesh.h:20
control joint positions in the mesh (eg. ragdolls, or set the animation from animateJoints() )
virtual IShadowVolumeSceneNode * addShadowVolumeSceneNode(const IMesh *shadowMesh=0, s32 id=-1, bool zfailmethod=true, f32 infinity=1000.0f)=0
Creates shadow volume scene node as child of this node.