IAnimatedMeshMD2.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. #ifndef IRR_I_ANIMATED_MESH_MD2_H_INCLUDED
  5. #define IRR_I_ANIMATED_MESH_MD2_H_INCLUDED
  6. #include "IAnimatedMesh.h"
  7. namespace irr
  8. {
  9. namespace scene
  10. {
  11. //! Types of standard md2 animations
  12. enum EMD2_ANIMATION_TYPE
  13. {
  14. EMAT_STAND = 0,
  15. EMAT_RUN,
  16. EMAT_ATTACK,
  17. EMAT_PAIN_A,
  18. EMAT_PAIN_B,
  19. EMAT_PAIN_C,
  20. EMAT_JUMP,
  21. EMAT_FLIP,
  22. EMAT_SALUTE,
  23. EMAT_FALLBACK,
  24. EMAT_WAVE,
  25. EMAT_POINT,
  26. EMAT_CROUCH_STAND,
  27. EMAT_CROUCH_WALK,
  28. EMAT_CROUCH_ATTACK,
  29. EMAT_CROUCH_PAIN,
  30. EMAT_CROUCH_DEATH,
  31. EMAT_DEATH_FALLBACK,
  32. EMAT_DEATH_FALLFORWARD,
  33. EMAT_DEATH_FALLBACKSLOW,
  34. EMAT_BOOM,
  35. //! Not an animation, but amount of animation types.
  36. EMAT_COUNT
  37. };
  38. //! Interface for using some special functions of MD2 meshes
  39. class IAnimatedMeshMD2 : public IAnimatedMesh
  40. {
  41. public:
  42. //! Get frame loop data for a default MD2 animation type.
  43. /** \param l The EMD2_ANIMATION_TYPE to get the frames for.
  44. \param outBegin The returned beginning frame for animation type specified.
  45. \param outEnd The returned ending frame for the animation type specified.
  46. \param outFPS The number of frames per second, this animation should be played at.
  47. \return beginframe, endframe and frames per second for a default MD2 animation type. */
  48. virtual void getFrameLoop(EMD2_ANIMATION_TYPE l, s32& outBegin,
  49. s32& outEnd, s32& outFPS) const = 0;
  50. //! Get frame loop data for a special MD2 animation type, identified by name.
  51. /** \param name Name of the animation.
  52. \param outBegin The returned beginning frame for animation type specified.
  53. \param outEnd The returned ending frame for the animation type specified.
  54. \param outFPS The number of frames per second, this animation should be played at.
  55. \return beginframe, endframe and frames per second for a special MD2 animation type. */
  56. virtual bool getFrameLoop(const c8* name,
  57. s32& outBegin, s32& outEnd, s32& outFPS) const = 0;
  58. //! Get amount of md2 animations in this file.
  59. virtual s32 getAnimationCount() const = 0;
  60. //! Get name of md2 animation.
  61. /** \param nr: Zero based index of animation. */
  62. virtual const c8* getAnimationName(s32 nr) const = 0;
  63. };
  64. } // end namespace scene
  65. } // end namespace irr
  66. #endif