SubMesh.hh
Go to the documentation of this file.
62 };
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Microsoft Visual Studio does not automatically export the interface information for member variables ...
Definition: SuppressWarning.hh:64
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: SuppressWarning.hh:67
Vertex to node weighted assignement for skeleton animation visualization.
Definition: SubMesh.hh:408
unsigned int nodeIndex
Node (or bone) index.
Definition: SubMesh.hh:416
float weight
The weight (between 0 and 1). This determines how much the node (bone) affects the vertex in animatio...
Definition: SubMesh.hh:420
unsigned int vertexIndex
Index of the vertex.
Definition: SubMesh.hh:413
void SetPrimitiveType(PrimitiveType _type)
Set the primitive type.
void Scale(const ignition::math::Vector3d &_factor)
Scale all vertices by _factor.
void GenSphericalTexCoordBySet(const ignition::math::Vector3d &_center, unsigned int _setIndex)
Generate texture coordinates for a texture coordinate set using spherical projection from center.
bool HasTexCoordBySet(unsigned int _index, unsigned int _setIndex) const
Return true if this submesh has the texture coordinate with the given index in a texture coordinate s...
void Translate(const ignition::math::Vector3d &_vec)
Move all vertices by _vec.
void AddVertex(const ignition::math::Vector3d &_v)
Add a vertex to the mesh.
void SetMaterialIndex(const unsigned int _index)
Set the material index. Relates to the parent mesh material list.
void Center(const ignition::math::Vector3d &_center=ignition::math::Vector3d::Zero)
Move the center of the submesh to the given coordinate. This will move all the vertices.
int IndexOfVertex(const ignition::math::Vector3d &_v) const
Get the index of the vertex.
PrimitiveType
An enumeration of the geometric mesh primitives.
Definition: SubMesh.hh:44
@ LINESTRIPS
Connected lines. 2 vertices for the first line and every vertex specified afterwards creates a new li...
Definition: SubMesh.hh:51
@ TRIFANS
Connected triangle in fan shape. 3 vertices for the first triangle and every vertex specified afterwa...
Definition: SubMesh.hh:57
@ TRIANGLES
Triangle type. 3 vertices per triangle.
Definition: SubMesh.hh:53
ignition::math::Vector3d Vertex(const unsigned int _index) const
Get a vertex.
bool HasVertex(const ignition::math::Vector3d &_v) const
Return true if this submesh has the vertex.
unsigned int TexCoordCountBySet(unsigned int _setIndex) const
Return the number of texture coordinates for a texture coordinate set.
void FillArrays(double **_vertArr, int **_indexndArr) const
Put all the data into flat arrays.
void SetNormal(const unsigned int _index, const ignition::math::Vector3d &_n)
Set a normal.
double Volume() const
Compute the volume of this submesh. The primitive type must be TRIANGLES.
void AddNodeAssignment(const unsigned int _vertex, const unsigned int _node, const float _weight)
Add a vertex - skeleton node assignment.
unsigned int MaxIndex() const
Get the highest value in the index array.
void SetVertex(const unsigned int _index, const ignition::math::Vector3d &_v)
Set a vertex.
ignition::math::Vector3d Normal(const unsigned int _index) const
Get a normal.
void AddTexCoordBySet(const ignition::math::Vector2d &_uv, unsigned int _setIndex)
Add a texture coord to a texture coordinate set of the mesh.
void AddVertex(const double _x, const double _y, const double _z)
Add a vertex to the mesh.
void SetIndex(const unsigned int _index, const unsigned int _i)
Set an index.
ignition::math::Vector3d Min() const
Get the minimum X, Y, Z values from all the vertices.
ignition::math::Vector3d Max() const
Get the maximum X, Y, Z values from all the vertices.
int Index(const unsigned int _index) const
Get an index value from the index array.
ignition::math::Vector2d TexCoord(const unsigned int _index) const
Get a texture coordinate.
void AddTexCoordBySet(double _u, double _v, unsigned int _setIndex)
Add a texture coord to a texture coordinate set of the mesh.
unsigned int TexCoordCount() const
Return the number of texture coordinates. If multiple texture coordinate sets exist,...
bool HasNormal(const unsigned int _index) const
Return true if this submesh has the normal with the given index.
void AddIndex(const unsigned int _index)
Add an index to the mesh.
unsigned int TexCoordSetCount() const
Return the number of texture coordinate sets.
void SetTexCoord(const unsigned int _index, const ignition::math::Vector2d &_uv)
Set a texture coordinate. If multiple texture coordinate sets exist, this function sets the texture c...
void GenSphericalTexCoord(const ignition::math::Vector3d &_center)
Generate texture coordinates using spherical projection from center.
ignition::math::Vector2d TexCoordBySet(unsigned int _index, unsigned int _setIndex) const
Get a texture coordinate for a texture coordinate set.
unsigned int NodeAssignmentsCount() const
Get the number of vertex-skeleton node assignments.
void AddTexCoord(const double _u, const double _v)
Add a texture coord to the mesh. If multiple texture coordinate sets exist, this function adds it to ...
bool HasTexCoord(const unsigned int _index) const
Return true if this submesh has the texture coordinate with the given index. If multiple texture coor...
bool HasVertex(const unsigned int _index) const
Return true if this submesh has the vertex with the given index.
bool HasNodeAssignment(const unsigned int _index) const
Return true if this submesh has the node assignment with the given index.
void AddNormal(const ignition::math::Vector3d &_n)
Add a normal to the mesh.
void SetTexCoordBySet(unsigned int _index, const ignition::math::Vector2d &_uv, unsigned int _setIdex)
Set a texture coordinate for a texture coordinate set.
NodeAssignment NodeAssignmentByIndex(const unsigned int _index) const
Get a vertex - skeleton node assignment.
void AddNormal(const double _x, const double _y, const double _z)
Add a normal to the mesh.
PrimitiveType SubMeshPrimitiveType() const
Get the primitive type.
void AddTexCoord(const ignition::math::Vector2d &_uv)
Add a texture coordinate to the mesh. If multiple texture coordinate sets exist, this function adds i...
static const Vector3 Zero
Forward declarations for the common classes.