00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __ANIMATEDMESHCOMPONENT_H__
00017 #define __ANIMATEDMESHCOMPONENT_H__
00018
00019
00020 #include "../../dependencies.h"
00021 #include "SceneComponent.h"
00022
00023
00024
00026 class AnimatedMeshComponent : public SceneComponent
00027 {
00028 public:
00029
00030
00033 AnimatedMeshComponent(Entity *parent);
00039 AnimatedMeshComponent(Entity *parent, const std::string &fileName,
00040 const vector3df &rotation = vector3df(0, 0, 0),
00041 const vector3df &scale = vector3df(1.0f, 1.0f, 1.0f));
00048 AnimatedMeshComponent(Entity *parent, IAnimatedMesh *mesh,
00049 const vector3df &rotation = vector3df(0, 0, 0),
00050 const vector3df &scale = vector3df(1.0f, 1.0f, 1.0f));
00052 ~AnimatedMeshComponent();
00053
00054
00057 static AnimatedMeshComponent* refFactory(Entity *parent);
00060 static AnimatedMeshComponent* refFactory(Entity *parent, const std::string &fileName,
00061 const vector3df &rotation, const vector3df &scale);
00062
00063
00066 IAnimatedMeshSceneNode* getAnimatedMeshSceneNode();
00067
00069 void animate();
00070
00072 s32 getEndFrame() const;
00074 f32 getFrame() const;
00077 IMesh* getMesh();
00080 IShadowVolumeSceneNode* getShadowVolumeSceneNode();
00082 s32 getStartFrame() const;
00083
00086 void setAnimationSpeed(f32 speed);
00089 void setCurrentFrame(f32 frame);
00093 void setFrameLoop(s32 start, s32 end);
00096 void setLoopMode(bool value);
00099 void setMD2Animation(const std::string &animationName);
00104 void setMD2Animation(EMD2_ANIMATION_TYPE anim);
00107 void setMesh(const std::string &fileName);
00111 void setMesh(IAnimatedMesh *mesh);
00117 void setShadowVolumeSceneNode(const std::string &fileName, bool zfailmethod = true,
00118 f32 infinity = 10000.0f);
00125 void setShadowVolumeSceneNode(IMesh *mesh, bool zfailmethod = true,
00126 f32 infinity = 10000.0f);
00129 void setTransitionTime(f32 time);
00130
00131 private:
00132
00133
00134 IAnimatedMeshSceneNode *mAnimatedMeshSN;
00135 IShadowVolumeSceneNode *mShadowVolumeSN;
00136 };
00137
00138
00139
00141 extern void bindAnimatedMeshComponent(asIScriptEngine *engine);
00142
00143 #endif