Go to the documentation of this file.
17 #ifndef GZ_COMMON_SUBMESH_HH_
18 #define GZ_COMMON_SUBMESH_HH_
24 #include <gz/math/Vector3.hh>
25 #include <gz/math/Vector2.hh>
28 #include <gz/common/graphics/Export.hh>
40 class IGNITION_COMMON_GRAPHICS_VISIBLE
SubMesh
88 public:
void SetPrimitiveType(PrimitiveType _type);
92 public: PrimitiveType SubMeshPrimitiveType()
const;
96 public:
void AddIndex(
const unsigned int _index);
100 public:
void AddVertex(
const gz::math::Vector3d &_v);
106 public:
void AddVertex(
const double _x,
const double _y,
const double _z);
110 public:
void AddNormal(
const gz::math::Vector3d &_n);
116 public:
void AddNormal(
const double _x,
const double _y,
const double _z);
125 public:
void AddTexCoord(
const double _u,
const double _v);
133 public:
void AddTexCoord(
const gz::math::Vector2d &_uv);
139 public:
void AddTexCoordBySet(
double _u,
double _v,
140 unsigned int _setIndex);
146 public:
void AddTexCoordBySet(
const gz::math::Vector2d &_uv,
147 unsigned int _setIndex);
153 public:
void AddNodeAssignment(
const unsigned int _vertex,
154 const unsigned int _node,
155 const float _weight);
161 public: gz::math::Vector3d Vertex(
const unsigned int _index)
const;
166 public:
void SetVertex(
const unsigned int _index,
167 const gz::math::Vector3d &_v);
174 public: gz::math::Vector3d Normal(
const unsigned int _index)
const;
179 public:
void SetNormal(
const unsigned int _index,
180 const gz::math::Vector3d &_n);
187 public: gz::math::Vector2d TexCoord(
188 const unsigned int _index)
const;
197 public: gz::math::Vector2d TexCoordBySet(
199 unsigned int _setIndex)
const;
207 public:
void SetTexCoord(
const unsigned int _index,
208 const gz::math::Vector2d &_uv);
214 public:
void SetTexCoordBySet(
unsigned int _index,
215 const gz::math::Vector2d &_uv,
216 unsigned int _setIdex);
221 public:
int Index(
const unsigned int _index)
const;
226 public:
void SetIndex(
const unsigned int _index,
227 const unsigned int _i);
236 const unsigned int _index)
const;
240 public: gz::math::Vector3d Max()
const;
244 public: gz::math::Vector3d Min()
const;
248 public:
unsigned int VertexCount()
const;
252 public:
unsigned int NormalCount()
const;
256 public:
unsigned int IndexCount()
const;
265 public:
unsigned int TexCoordCount()
const;
271 public:
unsigned int TexCoordCountBySet(
unsigned int _setIndex)
const;
275 public:
unsigned int TexCoordSetCount()
const;
279 public:
unsigned int NodeAssignmentsCount()
const;
283 public:
unsigned int MaxIndex()
const;
288 public:
void SetMaterialIndex(
const unsigned int _index);
292 public:
unsigned int MaterialIndex()
const;
297 public:
bool HasVertex(
const gz::math::Vector3d &_v)
const;
304 public:
bool HasVertex(
const unsigned int _index)
const;
311 public:
bool HasNormal(
const unsigned int _index)
const;
323 public:
bool HasTexCoord(
const unsigned int _index)
const;
331 public:
bool HasTexCoordBySet(
unsigned int _index,
unsigned int _setIndex)
339 public:
bool HasNodeAssignment(
const unsigned int _index)
const;
344 public:
int IndexOfVertex(
const gz::math::Vector3d &_v)
const;
349 public:
void FillArrays(
double **_vertArr,
int **_indexndArr)
const;
352 public:
void RecalculateNormals();
357 public:
void GenSphericalTexCoord(
358 const gz::math::Vector3d &_center);
364 public:
void GenSphericalTexCoordBySet(
365 const gz::math::Vector3d &_center,
366 unsigned int _setIndex);
370 public:
void Scale(
const gz::math::Vector3d &_factor);
374 public:
void Scale(
const double &_factor);
379 public:
void Center(
const gz::math::Vector3d &_center =
380 gz::math::Vector3d::Zero);
384 public:
void Translate(
const gz::math::Vector3d &_vec);
397 public:
double Volume()
const;
@ TRIFANS
Connected triangle in fan shape. 3 vertices for the first triangle and every vertex specified afterwa...
Definition: gz/common/SubMesh.hh:57
@ LINESTRIPS
Connected lines. 2 vertices for the first line and every vertex specified afterwards creates a new li...
Definition: gz/common/SubMesh.hh:51
Forward declarations for the common classes.
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Microsoft Visual Studio does not automatically export the interface information for member variables ...
Definition: gz/common/SuppressWarning.hh:65
Vertex to node weighted assignement for skeleton animation visualization.
Definition: gz/common/SubMesh.hh:407
@ POINTS
Point. 1 vertex per point.
Definition: gz/common/SubMesh.hh:46
float weight
The weight (between 0 and 1). This determines how much the node (bone) affects the vertex in animatio...
Definition: gz/common/SubMesh.hh:420
@ TRIANGLES
Triangle type. 3 vertices per triangle.
Definition: gz/common/SubMesh.hh:53
unsigned int nodeIndex
Node (or bone) index.
Definition: gz/common/SubMesh.hh:416
@ LINES
Line. 2 vertices per line.
Definition: gz/common/SubMesh.hh:48
PrimitiveType
An enumeration of the geometric mesh primitives.
Definition: gz/common/SubMesh.hh:43
unsigned int vertexIndex
Index of the vertex.
Definition: gz/common/SubMesh.hh:413
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: gz/common/SuppressWarning.hh:68
A child mesh.
Definition: gz/common/SubMesh.hh:40