Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials
ISkinnedMesh.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2010 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 
5 #ifndef __I_SKINNED_MESH_H_INCLUDED__
6 #define __I_SKINNED_MESH_H_INCLUDED__
7 
8 #include "irrArray.h"
9 #include "IBoneSceneNode.h"
10 #include "IAnimatedMesh.h"
11 #include "SSkinMeshBuffer.h"
12 
13 namespace irr
14 {
15 namespace scene
16 {
17 
19  {
20  // constant does use the current key-values without interpolation
22 
23  // linear interpolation
25 
28  };
29 
30 
32  class ISkinnedMesh : public IAnimatedMesh
33  {
34  public:
35 
37 
38  virtual u32 getJointCount() const = 0;
39 
41 
44  virtual const c8* getJointName(u32 number) const = 0;
45 
47 
49  virtual s32 getJointNumber(const c8* name) const = 0;
50 
52 
57  virtual bool useAnimationFrom(const ISkinnedMesh *mesh) = 0;
58 
60 
63  virtual void updateNormalsWhenAnimating(bool on) = 0;
64 
66  virtual void setInterpolationMode(E_INTERPOLATION_MODE mode) = 0;
67 
69  virtual void animateMesh(f32 frame, f32 blend)=0;
70 
72  virtual void skinMesh() = 0;
73 
75 
76  virtual void convertMeshToTangents() = 0;
77 
79  /* This feature is not implementated in Irrlicht yet */
80  virtual bool setHardwareSkinning(bool on) = 0;
81 
83  struct SWeight
84  {
86  u16 buffer_id; //I doubt 32bits is needed
87 
89  u32 vertex_id; //Store global ID here
90 
93 
94  private:
96  friend class CSkinnedMesh;
97  bool *Moved;
98  core::vector3df StaticPos;
99  core::vector3df StaticNormal;
100  };
101 
102 
105  {
108  };
109 
111  struct SScaleKey
112  {
115  };
116 
119  {
122  };
123 
125  struct SJoint
126  {
127  SJoint() : UseAnimationFrom(0), LocalAnimatedMatrix_Animated(false), GlobalSkinningSpace(false),
128  positionHint(-1),scaleHint(-1),rotationHint(-1)
129  {
130  }
131 
134 
137 
140 
143 
146 
149 
152 
155 
163 
164  core::matrix4 GlobalInversedMatrix; //the x format pre-calculates this
165 
166  private:
168  friend class CSkinnedMesh;
169 
170  SJoint *UseAnimationFrom;
171  bool LocalAnimatedMatrix_Animated;
172 
173  bool GlobalSkinningSpace;
174 
175  s32 positionHint;
176  s32 scaleHint;
177  s32 rotationHint;
178  };
179 
180 
181  //Interface for the mesh loaders (finalize should lock these functions, and they should have some prefix like loader_
182 
183  //these functions will use the needed arrays, set values, etc to help the loaders
184 
187 
189  virtual core::array<SJoint*>& getAllJoints() = 0;
190 
192  virtual const core::array<SJoint*>& getAllJoints() const = 0;
193 
195  virtual void finalize() = 0;
196 
198  virtual SSkinMeshBuffer* addMeshBuffer() = 0;
199 
201  virtual SJoint* addJoint(SJoint *parent=0) = 0;
202 
204  virtual SWeight* addWeight(SJoint *joint) = 0;
205 
207  virtual SPositionKey* addPositionKey(SJoint *joint) = 0;
209  virtual SScaleKey* addScaleKey(SJoint *joint) = 0;
211  virtual SRotationKey* addRotationKey(SJoint *joint) = 0;
212 
214  virtual bool isStatic()=0;
215  };
216 
217 } // end namespace scene
218 } // end namespace irr
219 
220 #endif
221 

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Fri Mar 21 2014 04:40:17 by Doxygen (1.8.1.2)