00001
00002
00003
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
00031 EJUOR_COUNT
00032 };
00033
00034
00035 class IAnimatedMeshSceneNode;
00036
00038
00042 class IAnimationEndCallBack : public virtual IReferenceCounted
00043 {
00044 public:
00045
00047
00050 virtual void OnAnimationEnd(IAnimatedMeshSceneNode* node) = 0;
00051 };
00052
00054
00056 class IAnimatedMeshSceneNode : public ISceneNode
00057 {
00058 public:
00059
00061 IAnimatedMeshSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
00062 const core::vector3df& position = core::vector3df(0,0,0),
00063 const core::vector3df& rotation = core::vector3df(0,0,0),
00064 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
00065 : ISceneNode(parent, mgr, id, position, rotation, scale) {}
00066
00068 virtual ~IAnimatedMeshSceneNode() {}
00069
00071
00075 virtual void setCurrentFrame(f32 frame) = 0;
00076
00078
00082 virtual bool setFrameLoop(s32 begin, s32 end) = 0;
00083
00085
00086 virtual void setAnimationSpeed(f32 framesPerSecond) = 0;
00087
00089
00104 virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh=0,
00105 s32 id=-1, bool zfailmethod=true, f32 infinity=10000.0f) = 0;
00106
00107
00109
00123 virtual IBoneSceneNode* getJointNode(const c8* jointName)=0;
00124
00126 virtual IBoneSceneNode* getJointNode(u32 jointID) = 0;
00127
00129
00130 virtual u32 getJointCount() const = 0;
00131
00133 virtual ISceneNode* getMS3DJointNode(const c8* jointName) = 0;
00134
00136 virtual ISceneNode* getXJointNode(const c8* jointName) = 0;
00137
00139
00146 virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim) = 0;
00147
00149
00161 virtual bool setMD2Animation(const c8* animationName) = 0;
00162
00164 virtual f32 getFrameNr() const = 0;
00166 virtual s32 getStartFrame() const = 0;
00168 virtual s32 getEndFrame() const = 0;
00169
00171
00172 virtual void setLoopMode(bool playAnimationLooped) = 0;
00173
00175
00178 virtual void setAnimationEndCallback(IAnimationEndCallBack* callback=0) = 0;
00179
00181
00182
00183
00184 virtual void setReadOnlyMaterials(bool readonly) = 0;
00185
00187 virtual bool isReadOnlyMaterials() const = 0;
00188
00190 virtual void setMesh(IAnimatedMesh* mesh) = 0;
00191
00193 virtual IAnimatedMesh* getMesh(void) = 0;
00194
00196 virtual const SMD3QuaternionTag* getMD3TagTransformation( const core::stringc & tagname) = 0;
00197
00199 virtual void setJointMode(E_JOINT_UPDATE_ON_RENDER mode)=0;
00200
00202
00205 virtual void setTransitionTime(f32 Time) =0;
00206
00208
00209 virtual void animateJoints(bool CalculateAbsolutePositions=true) = 0;
00210
00212
00213 virtual void setRenderFromIdentity( bool On )=0;
00214
00216
00219 virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) = 0;
00220
00221 };
00222
00223 }
00224 }
00225
00226 #endif
00227