IrrlichtEngine
IAnimatedMeshSceneNode.h
Go to the documentation of this file.
00001 // Copyright (C) 2002-2011 Nikolaus Gebhardt
00002 // This file is part of the "Irrlicht Engine".
00003 // For conditions of distribution and use, see copyright notice in irrlicht.h
00004 
00005 #ifndef __I_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__
00006 #define __I_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__
00007 
00008 #include "ISceneNode.h"
00009 #include "IBoneSceneNode.h"
00010 #include "IAnimatedMeshMD2.h"
00011 #include "IAnimatedMeshMD3.h"
00012 
00013 namespace irr
00014 {
00015 namespace scene
00016 {
00017         class IShadowVolumeSceneNode;
00018 
00019         enum E_JOINT_UPDATE_ON_RENDER
00020         {
00022                 EJUOR_NONE = 0,
00023 
00025                 EJUOR_READ,
00026 
00028                 EJUOR_CONTROL
00029         };
00030 
00031 
00032         class IAnimatedMeshSceneNode;
00033 
00035 
00039         class IAnimationEndCallBack : public virtual IReferenceCounted
00040         {
00041         public:
00042 
00044 
00047                 virtual void OnAnimationEnd(IAnimatedMeshSceneNode* node) = 0;
00048         };
00049 
00051 
00053         class IAnimatedMeshSceneNode : public ISceneNode
00054         {
00055         public:
00056 
00058                 IAnimatedMeshSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
00059                         const core::vector3df& position = core::vector3df(0,0,0),
00060                         const core::vector3df& rotation = core::vector3df(0,0,0),
00061                         const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
00062                         : ISceneNode(parent, mgr, id, position, rotation, scale) {}
00063 
00065                 virtual ~IAnimatedMeshSceneNode() {}
00066 
00068 
00072                 virtual void setCurrentFrame(f32 frame) = 0;
00073 
00075 
00079                 virtual bool setFrameLoop(s32 begin, s32 end) = 0;
00080 
00082 
00083                 virtual void setAnimationSpeed(f32 framesPerSecond) = 0;
00084 
00086 
00087                 virtual f32 getAnimationSpeed() const =0;
00088 
00090 
00105                 virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh=0,
00106                         s32 id=-1, bool zfailmethod=true, f32 infinity=10000.0f) = 0;
00107 
00108 
00110 
00124                 virtual IBoneSceneNode* getJointNode(const c8* jointName)=0;
00125 
00127                 virtual IBoneSceneNode* getJointNode(u32 jointID) = 0;
00128 
00130 
00131                 virtual u32 getJointCount() const = 0;
00132 
00134 
00141                 virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim) = 0;
00142 
00144 
00156                 virtual bool setMD2Animation(const c8* animationName) = 0;
00157 
00159                 virtual f32 getFrameNr() const = 0;
00161                 virtual s32 getStartFrame() const = 0;
00163                 virtual s32 getEndFrame() const = 0;
00164 
00166 
00167                 virtual void setLoopMode(bool playAnimationLooped) = 0;
00168 
00170 
00173                 virtual void setAnimationEndCallback(IAnimationEndCallBack* callback=0) = 0;
00174 
00176 
00179                 virtual void setReadOnlyMaterials(bool readonly) = 0;
00180 
00182                 virtual bool isReadOnlyMaterials() const = 0;
00183 
00185                 virtual void setMesh(IAnimatedMesh* mesh) = 0;
00186 
00188                 virtual IAnimatedMesh* getMesh(void) = 0;
00189 
00191                 virtual const SMD3QuaternionTag* getMD3TagTransformation( const core::stringc & tagname) = 0;
00192 
00194                 virtual void setJointMode(E_JOINT_UPDATE_ON_RENDER mode)=0;
00195 
00197 
00200                 virtual void setTransitionTime(f32 Time) =0;
00201 
00203 
00204                 virtual void animateJoints(bool CalculateAbsolutePositions=true) = 0;
00205 
00207 
00208                 virtual void setRenderFromIdentity( bool On )=0;
00209 
00211 
00214                 virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) = 0;
00215 
00216         };
00217 
00218 } // end namespace scene
00219 } // end namespace irr
00220 
00221 #endif
00222