Cafu Engine
Model_cmdl.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_MODEL_HPP_INCLUDED
8 #define CAFU_MODEL_HPP_INCLUDED
9 
10 #include "Templates/Array.hpp"
11 #include "MaterialSystem/MaterialManagerImpl.hpp"
12 #include "MaterialSystem/Mesh.hpp"
13 #include "Math3D/BoundingBox.hpp"
14 #include "Math3D/Matrix.hpp"
15 #include "AnimPose.hpp" // Only for TEMPORARILY implementing the "old" ModelT interface methods.
16 
17 #if defined(_WIN32) && _MSC_VER<1600
18 #include "pstdint.h" // Paul Hsieh's portable implementation of the stdint.h header.
19 #else
20 #include <stdint.h>
21 #endif
22 
23 
24 class AnimImporterT;
25 class MaterialT;
26 class ModelLoaderT;
27 namespace MatSys { class RenderMaterialT; }
28 namespace ModelEditor { class CommandAddT; }
29 namespace ModelEditor { class CommandDeleteT; }
30 namespace ModelEditor { class CommandRenameT; }
31 namespace ModelEditor { class CommandSetAnimFPST; }
32 namespace ModelEditor { class CommandSetAnimNextT; }
33 namespace ModelEditor { class CommandSetMaterialT; }
34 namespace ModelEditor { class CommandSetMeshTSMethodT; }
35 namespace ModelEditor { class CommandSetMeshShadowsT; }
36 namespace ModelEditor { class CommandTransformJointT; }
37 namespace ModelEditor { class CommandUpdateAnimT; }
38 namespace ModelEditor { class CommandUpdateChannelT; }
39 namespace ModelEditor { class CommandUpdateGuiFixtureT; }
40 namespace ModelEditor { class CommandUpdateTriangleT; }
41 namespace ModelEditor { class CommandUpdateUVCoordsT; }
42 
43 
44 /// This class represents a native Cafu model.
46 {
47  public:
48 
49  /// This struct represents a joint in the skeleton / a node in the hierarchy of the model.
50  struct JointT
51  {
52  std::string Name; ///< The name of the joint.
53  int Parent; ///< The parent of the root joint is -1.
54  Vector3fT Pos; ///< The position of the origin of the joint (relative, in the coordinate system of the parent joint).
55  Vector3fT Qtr; ///< The orientation of the coordinate axes of the joint.
56  Vector3fT Scale; ///< The scale of the coordinate axes of the joint.
57  };
58 
59 
60  /// This struct defines a triangle mesh in the model.
61  /// A mesh essentially consists of a list of triangles whose vertices are composed
62  /// of weighted positions that are attached to the joints of the model.
63  struct MeshT
64  {
65  /// The methods that can be used to generate the tangent-space axes at the vertices of a mesh.
67  {
68  HARD, ///< Hard edges, no smoothing: The tangent-space of the triangle is used as the tangent-space of its vertices. (Any smoothing groups info, if available, is ignored.)
69  GLOBAL, ///< Considers all triangles in the mesh to be in the same common smoothing group, and smoothes them globally. (Any smoothing groups info, if available, is ignored.) This method is equivalent to SM_GROUPS when all triangles are in the same smoothing group. It is also the default method, as it requires no smoothing groups info at all, provides better performance than SM_GROUPS, and was implemented in earlier versions of Cafu.
70  SM_GROUPS ///< [NOT YET IMPLEMENTED! At this time, this is the same as GLOBAL.] Like GLOBAL, but takes the given smoothing groups into account.
71  };
72 
73  /// A single triangle.
74  struct TriangleT
75  {
76  TriangleT(unsigned int v0=0, unsigned int v1=0, unsigned int v2=0);
77 
78  unsigned int VertexIdx[3]; ///< The indices to the three vertices that define this triangle.
79  uint32_t SmoothGroups; ///< The smoothing groups that this triangle is in: If bit \c i is set, the triangle is in smoothing group \c i.
80 
81  int NeighbIdx[3]; ///< The array indices of the three neighbouring triangles at the edges 01, 12 and 20. -1 indicates no neighbour, -2 indicates more than one neighbour.
82  bool Polarity; ///< True if this triangle has positive polarity (texture is not mirrored), or false if it has negative polarity (texture is mirrored, SxT points inward).
83  bool SkipDraw; ///< True if this triangle should be skipped when drawing the mesh (but not for casting stencil shadows and not for collision detection). This is useful for hiding triangles that are in the same plane as GUI panels and would otherwise cause z-fighting.
84  };
85 
86  /// A single vertex.
87  struct VertexT
88  {
89  float u; ///< Texture coordinate u.
90  float v; ///< Texture coordinate v.
91  unsigned int FirstWeightIdx;///< The index of the first weight in the Weights array.
92  unsigned int NumWeights; ///< The number of weights that form this vertex.
93 
94  bool Polarity; ///< True if this vertex belongs to triangles with positive polarity, false if it belongs to triangles with negative polarity. Note that a single vertex cannot belong to triangles of both positive and negative polarity (but a GeoDup of this vertex can belong to the other polarity).
95  ArrayT<unsigned int> GeoDups; ///< This array contains the indices of vertices that are geometrical duplicates of this vertex, see AreVerticesGeoDups() for more information. The indices are stored in increasing order, and do *not* include the index of "this" vertex. Note that from the presence of GeoDups in a cmdl/md5 file we can *not* conclude that a break in the smoothing was intended by the modeller. Cylindrically wrapping seams are one counter-example.
96  };
97 
98  /// A weight is a fixed position in the coordinate system of a joint.
99  struct WeightT
100  {
101  unsigned int JointIdx;
102  float Weight;
103  Vector3fT Pos;
104  };
105 
106 
107  /// The default constructor.
109 
110  /// Determines whether the two vertices with array indices Vertex1Nr and Vertex2Nr are geometrical duplicates of each other.
111  /// Two distinct vertices are geometrical duplicates of each other if
112  /// (a) they have the same NumWeights and the same FirstWeightIdx, or
113  /// (b) they have the same NumWeights and the referred weights have the same contents.
114  /// The two vertices may in general have different uv-coordinates, which are not considered for the geodup property.
115  /// Note that if Vertex1Nr==Vertex2Nr, true is returned (case (a) above).
116  /// @param Vertex1Nr Array index of first vertex.
117  /// @param Vertex2Nr Array index of second vertex.
118  /// @return Whether the vertices are geometrical duplicates of each other.
119  bool AreGeoDups(unsigned int Vertex1Nr, unsigned int Vertex2Nr) const;
120 
121  /// Returns a string representation of the TSMethod enum member.
122  std::string GetTSMethod() const;
123 
124  /// Sets the TSMethod enum member by string.
125  /// The given string should be one of the strings returned by GetTSMethod().
126  /// If the string does not match a known method, TSMethod is set to GLOBAL.
127  /// @param m The method to set TSMethod to.
128  void SetTSMethod(const std::string& m);
129 
130  std::string Name; ///< Name of this mesh.
131  MaterialT* Material; ///< The material of this mesh.
132  MatSys::RenderMaterialT* RenderMaterial; ///< The render material used to render this mesh.
133  TangentSpaceMethodT TSMethod; ///< How to generate the tangent-space axes at the vertices of this mesh? For meshes with normal-maps, the method should match the one that was used in the program that created the normal-maps.
134  bool CastShadows; ///< Should this mesh cast shadows?
135  ArrayT<TriangleT> Triangles; ///< List of triangles this mesh consists of.
136  ArrayT<VertexT> Vertices; ///< List of vertices this mesh consists of.
137  ArrayT<WeightT> Weights; ///< List of weights that are attached to the skeleton (hierarchy of bones/joints).
138  };
139 
140 
141  /// This struct describes additional/alternative skins for the meshes of this model.
142  struct SkinT
143  {
144  std::string Name; ///< The name of this skin.
145  ArrayT<MaterialT*> Materials; ///< For each mesh \c m, <tt>Materials[m]</tt> is the material for the mesh in this skin. If <tt>Materials[m]</tt> is NULL, the material of the default skin is used.
146  ArrayT<MatSys::RenderMaterialT*> RenderMaterials; ///< Analogous to \c Materials, these are the (possibly NULL) render materials for the meshes in this skin.
147  };
148 
149 
150  /// This struct defines how and where a GUI can be fixed to the model.
151  /// The GUI rectangle is defined by three points: the origin, the x-axis endpoint, and the y-axis endpoint, numbered 0, 1 and 2.
152  /// Each point is represented by an arbitrary vertex of one of meshes in the model.
153  /// The whole GUI rectangle can be translated and scaled, in order to compensate for cases where the mesh vertices do not
154  /// exactly match the desired rectangle dimensions.
155  /// More than one GUI can be fixed to a model, and if the referenced mesh vertices are animated, the GUI rectangle is animated, too.
156  struct GuiFixtureT
157  {
158  GuiFixtureT();
159 
160  struct PointT
161  {
162  unsigned int MeshNr;
163  unsigned int VertexNr;
164  };
165 
166  std::string Name;
167  PointT Points[3];
168  float Trans[2];
169  float Scale[2];
170  };
171 
172 
173  /// This struct describes one animation sequence, e.g.\ "run", "walk", "jump", etc.
174  /// We use it to obtain an array of joints (ArrayT<JointT>, just like m_Joints) for any point (frame number) in the animation sequence.
175  struct AnimT
176  {
177  struct AnimJointT
178  {
179  // std::string Name; ///< Checked to be identical with the name of the base mesh at load time.
180  // int Parent; ///< Checked to be identical with the value of the base mesh at load time.
181  Vector3fT DefaultPos; ///< The default position of the origin of the joint (relative, in the coordinate system of the parent joint). Used for all frames in this anim sequence unless bits 0 to 2 in @c Flags indicate that we have individiual values for each frame.
182  Vector3fT DefaultQtr; ///< The default orientation of the coordinate axes of the joint. Used for all frames in this anim sequence unless bits 3 to 5 in @c Flags indicate that we have individiual values for each frame.
183  Vector3fT DefaultScale; ///< The default scale of the coordinate axes of the joint. Used for all frames in this anim sequence unless bits 6 to 8 in @c Flags indicate that we have individiual values for each frame.
184  unsigned int Flags; ///< If the i-th bit in Flags is \emph{not} set, DefaultPos[i], DefaultQtr[i-3] and DefaultScale[i-6] are used for all frames in this anim sequence. Otherwise, for each set bit, we find frame-specific values in AnimData[FirstDataIdx+...].
185  unsigned int FirstDataIdx; ///< If f is the current frame, this is the index into Frames[f].AnimData[...].
186  // int NumDatas; ///< There are so many data values as there are bits set in Flags.
187  };
188 
189  /// A keyframe in the animation.
190  struct FrameT
191  {
192  BoundingBox3fT BB; ///< The bounding box of the model in this frame.
193  ArrayT<float> AnimData;
194  };
195 
196 
197  /// Recomputes the bounding-box for the specified frame in this animation sequence.
198  /// @param FrameNr The number of the frame to recompute the bounding-box for.
199  /// @param Joints The joints of the related model.
200  /// @param Meshes The meshes of the related model.
201  void RecomputeBB(unsigned int FrameNr, const ArrayT<JointT>& Joints, const ArrayT<MeshT>& Meshes);
202 
203  /// Returns whether the first frame in the sequence is equal to the last.
204  /// The editor may use this to ask the user if he wishes to delete the last frame.
205  bool IsLastFrameDup() const;
206 
207  std::string Name; ///< Name of this animation sequence.
208  float FPS; ///< Playback rate for this animation sequence.
209  int Next; ///< The sequence that should play after this. Use "this" for looping sequences, -1 for none.
210  // ... Events; ///< E.g. "call a script function at frame 3".
211  ArrayT<AnimJointT> AnimJoints; ///< AnimJoints.Size() == m_Joints.Size()
212  ArrayT<FrameT> Frames; ///< List of keyframes this animation consists of.
213  };
214 
215 
216  /// Channels allow animations to play only on a subset of the joints,
217  /// so that multiple animations can play on different parts of the model at the same time.
218  /// For example, you can play a walking animation on the legs, an animation for swinging
219  /// the arms on the upper body, and an animation for moving the eyes on the head.
220  ///
221  /// Technically, a channel defines a group of joints. It is used to limit or "filter"
222  /// animations such that they affect only the joints that are members of the channel.
223  struct ChannelT
224  {
225  std::string Name; ///< The name of this channel.
226 
227  bool IsMember(unsigned int JointNr) const;
228  void SetMember(unsigned int JointNr, bool Member=true);
229 
230 
231  private:
232 
233  ArrayT<uint32_t> m_BitBlocks;
234  };
235 
236 
237  /// The constructor. Creates a new Cafu model from a file as directed by the given model loader.
238  /// @param Loader The model loader that actually imports the file and fills in the model data.
239  CafuModelT(ModelLoaderT& Loader);
240 
241  /// The destructor.
242  ~CafuModelT();
243 
244  /// Imports animations into this model using the given AnimImporterT.
245  /// At this time, this method is actually unused, because in the Model Editor,
246  /// the related command is a friend and thus accesses the m_Anims member directly.
247  void Import(AnimImporterT& Importer);
248 
249  /// Saves the model into the given stream.
250  void Save(std::ostream& OutStream) const;
251 
252  // Inspector methods.
253  const std::string& GetFileName() const { return m_FileName; }
254  const MaterialManagerImplT& GetMaterialManager() const { return m_MaterialMan; }
255  const ArrayT<JointT>& GetJoints() const { return m_Joints; }
256  const ArrayT<MeshT>& GetMeshes() const { return m_Meshes; }
257  const ArrayT<SkinT>& GetSkins() const { return m_Skins; }
258  const ArrayT<GuiFixtureT>& GetGuiFixtures() const { return m_GuiFixtures; }
259  const ArrayT<AnimT>& GetAnims() const { return m_Anims; }
260  const ArrayT<ChannelT>& GetChannels() const { return m_Channels; }
261  const CafuModelT* GetDlodModel() const { return m_DlodModel; }
262  float GetDlodDist() const { return m_DlodDist; }
263 
264  /// Returns the proper material for the given mesh in the given skin.
265  const MaterialT* GetMaterial(unsigned long MeshNr, int SkinNr) const;
266 
267  /// Returns the proper render material for the given mesh in the given skin.
268  MatSys::RenderMaterialT* GetRenderMaterial(unsigned long MeshNr, int SkinNr) const;
269 
270  /// Determines if <tt>GF.Points[PointNr].MeshNr</tt> is a valid index into this model.
271  bool IsMeshNrOK(const GuiFixtureT& GF, unsigned int PointNr) const;
272 
273  /// Determines if <tt>GF.Points[PointNr].VertexNr</tt> is a valid index into this model.
274  bool IsVertexNrOK(const GuiFixtureT& GF, unsigned int PointNr) const;
275 
276  /// This method returns the pool of anim expressions for this model.
277  AnimExprPoolT& GetAnimExprPool() const { return m_AnimExprPool; }
278 
279  /// This method is strictly for backwards-compatibility only, do not use in new code!
281 
282  /// Prints some model data to stdout, used for debugging.
283  void Print() const;
284 
285  /// The current version of the \c cmdl file format.
286  static const unsigned int CMDL_FILE_VERSION;
287 
288 
289  private:
290 
291  friend class ModelEditor::CommandAddT;
292  friend class ModelEditor::CommandDeleteT;
293  friend class ModelEditor::CommandRenameT;
294  friend class ModelEditor::CommandSetAnimFPST;
300  friend class ModelEditor::CommandUpdateAnimT;
305 
306  CafuModelT(const CafuModelT&); ///< Use of the Copy Constructor is not allowed.
307  void operator = (const CafuModelT&); ///< Use of the Assignment Operator is not allowed.
308 
309  void InitMeshes(); ///< An auxiliary method for the constructors.
310 
311  const std::string m_FileName; ///< File name of this model. TODO: Remove!?!
312  MaterialManagerImplT m_MaterialMan; ///< The material manager for the materials that are used with the meshes of this model.
313  ArrayT<JointT> m_Joints; ///< Array of joints of this model.
314  ArrayT<MeshT> m_Meshes; ///< Array of (sub)meshes of this model.
315  ArrayT<SkinT> m_Skins; ///< Array of additional/alternative skins for this model.
316  ArrayT<GuiFixtureT> m_GuiFixtures; ///< Array of GUI fixtures in the model.
317  ArrayT<AnimT> m_Anims; ///< Array of animations of this model.
318  ArrayT<ChannelT> m_Channels; ///< Array of channels in this model.
319 
320  CafuModelT* m_DlodModel; ///< Use the m_DlodModel instead of this when the camera is more than m_DlodDist away.
321  float m_DlodDist; ///< The distance beyond which the m_DlodModel is used instead of this.
322 
323  mutable AnimExprPoolT m_AnimExprPool; ///< The pool of anim expressions for this model.
324  mutable AnimPoseT* m_TEMP_Pose; ///< TEMPORARY!
325 };
326 
327 #endif
Definition: Delete.hpp:21
Vector3fT DefaultQtr
The default orientation of the coordinate axes of the joint. Used for all frames in this anim sequenc...
Definition: Model_cmdl.hpp:182
ArrayT< FrameT > Frames
List of keyframes this animation consists of.
Definition: Model_cmdl.hpp:212
std::string Name
Name of this animation sequence.
Definition: Model_cmdl.hpp:207
bool AreGeoDups(unsigned int Vertex1Nr, unsigned int Vertex2Nr) const
Determines whether the two vertices with array indices Vertex1Nr and Vertex2Nr are geometrical duplic...
Definition: Model_cmdl.cpp:92
This struct describes one animation sequence, e.g. "run", "walk", "jump", etc.
Definition: Model_cmdl.hpp:175
This class represents a surface render material.
Definition: RenderMaterial.hpp:25
Definition: Add.hpp:21
This class represents a native Cafu model.
Definition: Model_cmdl.hpp:45
The base class for importing additional animations into an existing CafuModelT.
Definition: Loader.hpp:115
A single triangle.
Definition: Model_cmdl.hpp:74
static const unsigned int CMDL_FILE_VERSION
The current version of the cmdl file format.
Definition: Model_cmdl.hpp:286
std::string Name
Name of this mesh.
Definition: Model_cmdl.hpp:130
void Print() const
Prints some model data to stdout, used for debugging.
Definition: Model_cmdl.cpp:948
Definition: UpdateChannel.hpp:18
CafuModelT(ModelLoaderT &Loader)
The constructor.
Definition: Model_cmdl.cpp:266
ArrayT< MatSys::RenderMaterialT * > RenderMaterials
Analogous to Materials, these are the (possibly NULL) render materials for the meshes in this skin...
Definition: Model_cmdl.hpp:146
bool IsVertexNrOK(const GuiFixtureT &GF, unsigned int PointNr) const
Determines if GF.Points[PointNr].VertexNr is a valid index into this model.
Definition: Model_cmdl.cpp:933
Definition: TransformJoint.hpp:18
const MaterialT * GetMaterial(unsigned long MeshNr, int SkinNr) const
Returns the proper material for the given mesh in the given skin.
Definition: Model_cmdl.cpp:893
unsigned int Flags
If the i-th bit in Flags is not set, DefaultPos[i], DefaultQtr[i-3] and DefaultScale[i-6] are used fo...
Definition: Model_cmdl.hpp:184
Definition: SetMeshTSMethod.hpp:18
bool Polarity
True if this triangle has positive polarity (texture is not mirrored), or false if it has negative po...
Definition: Model_cmdl.hpp:82
unsigned int NumWeights
The number of weights that form this vertex.
Definition: Model_cmdl.hpp:92
ArrayT< WeightT > Weights
List of weights that are attached to the skeleton (hierarchy of bones/joints).
Definition: Model_cmdl.hpp:137
Definition: Model_cmdl.hpp:177
BoundingBox3fT BB
The bounding box of the model in this frame.
Definition: Model_cmdl.hpp:192
Definition: Model_cmdl.hpp:160
std::string GetTSMethod() const
Returns a string representation of the TSMethod enum member.
Definition: Model_cmdl.cpp:121
Definition: UpdateAnim.hpp:18
Definition: SetAnimNext.hpp:17
ArrayT< VertexT > Vertices
List of vertices this mesh consists of.
Definition: Model_cmdl.hpp:136
[NOT YET IMPLEMENTED! At this time, this is the same as GLOBAL.] Like GLOBAL, but takes the given smo...
Definition: Model_cmdl.hpp:70
AnimExprPoolT & GetAnimExprPool() const
This method returns the pool of anim expressions for this model.
Definition: Model_cmdl.hpp:277
unsigned int VertexIdx[3]
The indices to the three vertices that define this triangle.
Definition: Model_cmdl.hpp:78
Vector3fT Qtr
The orientation of the coordinate axes of the joint.
Definition: Model_cmdl.hpp:55
The base class for importing arbitrary model files into Cafu models.
Definition: Loader.hpp:15
std::string Name
The name of this skin.
Definition: Model_cmdl.hpp:144
Vector3fT Scale
The scale of the coordinate axes of the joint.
Definition: Model_cmdl.hpp:56
A keyframe in the animation.
Definition: Model_cmdl.hpp:190
void RecomputeBB(unsigned int FrameNr, const ArrayT< JointT > &Joints, const ArrayT< MeshT > &Meshes)
Recomputes the bounding-box for the specified frame in this animation sequence.
Definition: Model_cmdl.cpp:161
int NeighbIdx[3]
The array indices of the three neighbouring triangles at the edges 01, 12 and 20. -1 indicates no nei...
Definition: Model_cmdl.hpp:81
bool Polarity
True if this vertex belongs to triangles with positive polarity, false if it belongs to triangles wit...
Definition: Model_cmdl.hpp:94
Definition: AnimExpr.hpp:224
unsigned int FirstWeightIdx
The index of the first weight in the Weights array.
Definition: Model_cmdl.hpp:91
Vector3fT Pos
The position of the origin of the joint (relative, in the coordinate system of the parent joint)...
Definition: Model_cmdl.hpp:54
This struct defines a triangle mesh in the model.
Definition: Model_cmdl.hpp:63
This class represents a surface material ("A datastructural representation of a scripts material def...
Definition: Material.hpp:22
AnimPoseT * GetSharedPose(IntrusivePtrT< AnimExpressionT > AE) const
This method is strictly for backwards-compatibility only, do not use in new code! ...
Definition: Model_cmdl.cpp:940
TangentSpaceMethodT TSMethod
How to generate the tangent-space axes at the vertices of this mesh? For meshes with normal-maps...
Definition: Model_cmdl.hpp:133
This command sets a new material for a given mesh in a given skin.
Definition: SetMaterial.hpp:22
MatSys::RenderMaterialT * GetRenderMaterial(unsigned long MeshNr, int SkinNr) const
Returns the proper render material for the given mesh in the given skin.
Definition: Model_cmdl.cpp:910
Definition: UpdateTriangle.hpp:17
void Import(AnimImporterT &Importer)
Imports animations into this model using the given AnimImporterT.
Definition: Model_cmdl.cpp:373
ArrayT< MaterialT * > Materials
For each mesh m, Materials[m] is the material for the mesh in this skin. If Materials[m] is NULL...
Definition: Model_cmdl.hpp:145
Considers all triangles in the mesh to be in the same common smoothing group, and smoothes them globa...
Definition: Model_cmdl.hpp:69
bool CastShadows
Should this mesh cast shadows?
Definition: Model_cmdl.hpp:134
This struct represents a joint in the skeleton / a node in the hierarchy of the model.
Definition: Model_cmdl.hpp:50
uint32_t SmoothGroups
The smoothing groups that this triangle is in: If bit i is set, the triangle is in smoothing group i...
Definition: Model_cmdl.hpp:79
float FPS
Playback rate for this animation sequence.
Definition: Model_cmdl.hpp:208
ArrayT< AnimJointT > AnimJoints
AnimJoints.Size() == m_Joints.Size()
Definition: Model_cmdl.hpp:211
This class implements the MaterialManagerI interface.
Definition: MaterialManagerImpl.hpp:23
MaterialT * Material
The material of this mesh.
Definition: Model_cmdl.hpp:131
TangentSpaceMethodT
The methods that can be used to generate the tangent-space axes at the vertices of a mesh...
Definition: Model_cmdl.hpp:66
bool SkipDraw
True if this triangle should be skipped when drawing the mesh (but not for casting stencil shadows an...
Definition: Model_cmdl.hpp:83
~CafuModelT()
The destructor.
Definition: Model_cmdl.cpp:353
void Save(std::ostream &OutStream) const
Saves the model into the given stream.
Definition: Model_cmdl.cpp:656
int Next
The sequence that should play after this. Use "this" for looping sequences, -1 for none...
Definition: Model_cmdl.hpp:209
Channels allow animations to play only on a subset of the joints, so that multiple animations can pla...
Definition: Model_cmdl.hpp:223
Definition: UpdateUVCoords.hpp:21
Definition: Rename.hpp:18
Vector3fT DefaultScale
The default scale of the coordinate axes of the joint. Used for all frames in this anim sequence unle...
Definition: Model_cmdl.hpp:183
ArrayT< unsigned int > GeoDups
This array contains the indices of vertices that are geometrical duplicates of this vertex...
Definition: Model_cmdl.hpp:95
Definition: UpdateGuiFixture.hpp:18
Definition: Delete.hpp:22
MeshT()
The default constructor.
Definition: Model_cmdl.hpp:108
std::string Name
The name of this channel.
Definition: Model_cmdl.hpp:225
float v
Texture coordinate v.
Definition: Model_cmdl.hpp:90
float u
Texture coordinate u.
Definition: Model_cmdl.hpp:89
A weight is a fixed position in the coordinate system of a joint.
Definition: Model_cmdl.hpp:99
A single vertex.
Definition: Model_cmdl.hpp:87
Definition: SetMeshShadows.hpp:17
This class describes a specific pose of an associated model.
Definition: AnimPose.hpp:35
int Parent
The parent of the root joint is -1.
Definition: Model_cmdl.hpp:53
bool IsMeshNrOK(const GuiFixtureT &GF, unsigned int PointNr) const
Determines if GF.Points[PointNr].MeshNr is a valid index into this model.
Definition: Model_cmdl.cpp:927
Definition: SetAnimFPS.hpp:17
Vector3fT DefaultPos
The default position of the origin of the joint (relative, in the coordinate system of the parent joi...
Definition: Model_cmdl.hpp:181
MatSys::RenderMaterialT * RenderMaterial
The render material used to render this mesh.
Definition: Model_cmdl.hpp:132
bool IsLastFrameDup() const
Returns whether the first frame in the sequence is equal to the last.
Definition: Model_cmdl.cpp:231
std::string Name
The name of the joint.
Definition: Model_cmdl.hpp:52
This struct defines how and where a GUI can be fixed to the model.
Definition: Model_cmdl.hpp:156
This struct describes additional/alternative skins for the meshes of this model.
Definition: Model_cmdl.hpp:142
void SetTSMethod(const std::string &m)
Sets the TSMethod enum member by string.
Definition: Model_cmdl.cpp:134
Hard edges, no smoothing: The tangent-space of the triangle is used as the tangent-space of its verti...
Definition: Model_cmdl.hpp:68
ArrayT< TriangleT > Triangles
List of triangles this mesh consists of.
Definition: Model_cmdl.hpp:135
unsigned int FirstDataIdx
If f is the current frame, this is the index into Frames[f].AnimData[...].
Definition: Model_cmdl.hpp:185