diff options
author | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
commit | 959831f4ef5a3e797f576c3de08cd65032c997ad (patch) | |
tree | e7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/source/Irrlicht/CAnimatedMeshMD2.h | |
parent | Add info about changes to Irrlicht. (diff) | |
download | SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2 SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz |
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CAnimatedMeshMD2.h | 308 |
1 files changed, 154 insertions, 154 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CAnimatedMeshMD2.h b/libraries/irrlicht-1.8/source/Irrlicht/CAnimatedMeshMD2.h index 0014910..1f336a4 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CAnimatedMeshMD2.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CAnimatedMeshMD2.h | |||
@@ -1,154 +1,154 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __C_ANIMATED_MESH_MD2_H_INCLUDED__ | 5 | #ifndef __C_ANIMATED_MESH_MD2_H_INCLUDED__ |
6 | #define __C_ANIMATED_MESH_MD2_H_INCLUDED__ | 6 | #define __C_ANIMATED_MESH_MD2_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IAnimatedMeshMD2.h" | 8 | #include "IAnimatedMeshMD2.h" |
9 | #include "IMesh.h" | 9 | #include "IMesh.h" |
10 | #include "CMeshBuffer.h" | 10 | #include "CMeshBuffer.h" |
11 | #include "IReadFile.h" | 11 | #include "IReadFile.h" |
12 | #include "S3DVertex.h" | 12 | #include "S3DVertex.h" |
13 | #include "irrArray.h" | 13 | #include "irrArray.h" |
14 | #include "irrString.h" | 14 | #include "irrString.h" |
15 | 15 | ||
16 | namespace irr | 16 | namespace irr |
17 | { | 17 | { |
18 | namespace scene | 18 | namespace scene |
19 | { | 19 | { |
20 | 20 | ||
21 | class CAnimatedMeshMD2 : public IAnimatedMeshMD2 | 21 | class CAnimatedMeshMD2 : public IAnimatedMeshMD2 |
22 | { | 22 | { |
23 | public: | 23 | public: |
24 | 24 | ||
25 | //! constructor | 25 | //! constructor |
26 | CAnimatedMeshMD2(); | 26 | CAnimatedMeshMD2(); |
27 | 27 | ||
28 | //! destructor | 28 | //! destructor |
29 | virtual ~CAnimatedMeshMD2(); | 29 | virtual ~CAnimatedMeshMD2(); |
30 | 30 | ||
31 | //! returns the amount of frames. If the amount is 1, it is a static (=non animated) mesh. | 31 | //! returns the amount of frames. If the amount is 1, it is a static (=non animated) mesh. |
32 | virtual u32 getFrameCount() const; | 32 | virtual u32 getFrameCount() const; |
33 | 33 | ||
34 | //! Gets the default animation speed of the animated mesh. | 34 | //! Gets the default animation speed of the animated mesh. |
35 | /** \return Amount of frames per second. If the amount is 0, it is a static, non animated mesh. */ | 35 | /** \return Amount of frames per second. If the amount is 0, it is a static, non animated mesh. */ |
36 | virtual f32 getAnimationSpeed() const | 36 | virtual f32 getAnimationSpeed() const |
37 | { | 37 | { |
38 | return FramesPerSecond; | 38 | return FramesPerSecond; |
39 | } | 39 | } |
40 | 40 | ||
41 | //! Gets the frame count of the animated mesh. | 41 | //! Gets the frame count of the animated mesh. |
42 | /** \param fps Frames per second to play the animation with. If the amount is 0, it is not animated. | 42 | /** \param fps Frames per second to play the animation with. If the amount is 0, it is not animated. |
43 | The actual speed is set in the scene node the mesh is instantiated in.*/ | 43 | The actual speed is set in the scene node the mesh is instantiated in.*/ |
44 | virtual void setAnimationSpeed(f32 fps) | 44 | virtual void setAnimationSpeed(f32 fps) |
45 | { | 45 | { |
46 | FramesPerSecond=fps; | 46 | FramesPerSecond=fps; |
47 | } | 47 | } |
48 | 48 | ||
49 | //! returns the animated mesh based on a detail level. 0 is the lowest, 255 the highest detail. Note, that some Meshes will ignore the detail level. | 49 | //! returns the animated mesh based on a detail level. 0 is the lowest, 255 the highest detail. Note, that some Meshes will ignore the detail level. |
50 | virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1); | 50 | virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1); |
51 | 51 | ||
52 | //! returns amount of mesh buffers. | 52 | //! returns amount of mesh buffers. |
53 | virtual u32 getMeshBufferCount() const; | 53 | virtual u32 getMeshBufferCount() const; |
54 | 54 | ||
55 | //! returns pointer to a mesh buffer | 55 | //! returns pointer to a mesh buffer |
56 | virtual IMeshBuffer* getMeshBuffer(u32 nr) const; | 56 | virtual IMeshBuffer* getMeshBuffer(u32 nr) const; |
57 | 57 | ||
58 | //! Returns pointer to a mesh buffer which fits a material | 58 | //! Returns pointer to a mesh buffer which fits a material |
59 | /** \param material: material to search for | 59 | /** \param material: material to search for |
60 | \return Returns the pointer to the mesh buffer or | 60 | \return Returns the pointer to the mesh buffer or |
61 | NULL if there is no such mesh buffer. */ | 61 | NULL if there is no such mesh buffer. */ |
62 | virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const; | 62 | virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const; |
63 | 63 | ||
64 | //! returns an axis aligned bounding box | 64 | //! returns an axis aligned bounding box |
65 | virtual const core::aabbox3d<f32>& getBoundingBox() const; | 65 | virtual const core::aabbox3d<f32>& getBoundingBox() const; |
66 | 66 | ||
67 | //! set user axis aligned bounding box | 67 | //! set user axis aligned bounding box |
68 | virtual void setBoundingBox( const core::aabbox3df& box); | 68 | virtual void setBoundingBox( const core::aabbox3df& box); |
69 | 69 | ||
70 | //! sets a flag of all contained materials to a new value | 70 | //! sets a flag of all contained materials to a new value |
71 | virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue); | 71 | virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue); |
72 | 72 | ||
73 | //! set the hardware mapping hint, for driver | 73 | //! set the hardware mapping hint, for driver |
74 | virtual void setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX); | 74 | virtual void setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX); |
75 | 75 | ||
76 | //! flags the meshbuffer as changed, reloads hardware buffers | 76 | //! flags the meshbuffer as changed, reloads hardware buffers |
77 | virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX); | 77 | virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX); |
78 | 78 | ||
79 | //! Returns the type of the animated mesh. | 79 | //! Returns the type of the animated mesh. |
80 | virtual E_ANIMATED_MESH_TYPE getMeshType() const; | 80 | virtual E_ANIMATED_MESH_TYPE getMeshType() const; |
81 | 81 | ||
82 | //! Returns frame loop data for a special MD2 animation type. | 82 | //! Returns frame loop data for a special MD2 animation type. |
83 | virtual void getFrameLoop(EMD2_ANIMATION_TYPE, | 83 | virtual void getFrameLoop(EMD2_ANIMATION_TYPE, |
84 | s32& outBegin, s32& outEnd, s32& outFps) const; | 84 | s32& outBegin, s32& outEnd, s32& outFps) const; |
85 | 85 | ||
86 | //! Returns frame loop data for a special MD2 animation type. | 86 | //! Returns frame loop data for a special MD2 animation type. |
87 | virtual bool getFrameLoop(const c8* name, | 87 | virtual bool getFrameLoop(const c8* name, |
88 | s32& outBegin, s32& outEnd, s32& outFps) const; | 88 | s32& outBegin, s32& outEnd, s32& outFps) const; |
89 | 89 | ||
90 | //! Returns amount of md2 animations in this file. | 90 | //! Returns amount of md2 animations in this file. |
91 | virtual s32 getAnimationCount() const; | 91 | virtual s32 getAnimationCount() const; |
92 | 92 | ||
93 | //! Returns name of md2 animation. | 93 | //! Returns name of md2 animation. |
94 | //! \param nr: Zero based index of animation. | 94 | //! \param nr: Zero based index of animation. |
95 | virtual const c8* getAnimationName(s32 nr) const; | 95 | virtual const c8* getAnimationName(s32 nr) const; |
96 | 96 | ||
97 | 97 | ||
98 | // | 98 | // |
99 | // exposed for loader | 99 | // exposed for loader |
100 | // | 100 | // |
101 | 101 | ||
102 | //! the buffer that contains the most recent animation | 102 | //! the buffer that contains the most recent animation |
103 | SMeshBuffer* InterpolationBuffer; | 103 | SMeshBuffer* InterpolationBuffer; |
104 | 104 | ||
105 | //! named animations | 105 | //! named animations |
106 | struct SAnimationData | 106 | struct SAnimationData |
107 | { | 107 | { |
108 | core::stringc name; | 108 | core::stringc name; |
109 | s32 begin; | 109 | s32 begin; |
110 | s32 end; | 110 | s32 end; |
111 | s32 fps; | 111 | s32 fps; |
112 | }; | 112 | }; |
113 | 113 | ||
114 | //! scale and translations for keyframes | 114 | //! scale and translations for keyframes |
115 | struct SKeyFrameTransform | 115 | struct SKeyFrameTransform |
116 | { | 116 | { |
117 | core::vector3df scale; | 117 | core::vector3df scale; |
118 | core::vector3df translate; | 118 | core::vector3df translate; |
119 | }; | 119 | }; |
120 | 120 | ||
121 | //! md2 vertex data | 121 | //! md2 vertex data |
122 | struct SMD2Vert | 122 | struct SMD2Vert |
123 | { | 123 | { |
124 | core::vector3d<u8> Pos; | 124 | core::vector3d<u8> Pos; |
125 | u8 NormalIdx; | 125 | u8 NormalIdx; |
126 | }; | 126 | }; |
127 | 127 | ||
128 | //! keyframe transformations | 128 | //! keyframe transformations |
129 | core::array<SKeyFrameTransform> FrameTransforms; | 129 | core::array<SKeyFrameTransform> FrameTransforms; |
130 | 130 | ||
131 | //! keyframe vertex data | 131 | //! keyframe vertex data |
132 | core::array<SMD2Vert> *FrameList; | 132 | core::array<SMD2Vert> *FrameList; |
133 | 133 | ||
134 | //! bounding boxes for each keyframe | 134 | //! bounding boxes for each keyframe |
135 | core::array<core::aabbox3d<f32> > BoxList; | 135 | core::array<core::aabbox3d<f32> > BoxList; |
136 | 136 | ||
137 | //! named animations | 137 | //! named animations |
138 | core::array< SAnimationData > AnimationData; | 138 | core::array< SAnimationData > AnimationData; |
139 | 139 | ||
140 | u32 FrameCount; | 140 | u32 FrameCount; |
141 | 141 | ||
142 | private: | 142 | private: |
143 | 143 | ||
144 | //! updates the interpolation buffer | 144 | //! updates the interpolation buffer |
145 | void updateInterpolationBuffer(s32 frame, s32 startFrame, s32 endFrame); | 145 | void updateInterpolationBuffer(s32 frame, s32 startFrame, s32 endFrame); |
146 | 146 | ||
147 | f32 FramesPerSecond; | 147 | f32 FramesPerSecond; |
148 | }; | 148 | }; |
149 | 149 | ||
150 | } // end namespace scene | 150 | } // end namespace scene |
151 | } // end namespace irr | 151 | } // end namespace irr |
152 | 152 | ||
153 | #endif | 153 | #endif |
154 | 154 | ||