#include <Mesh.hh>
Public Types | |
enum | PrimitiveType { POINTS, LINES, LINESTRIPS, TRIANGLES, TRIFANS, TRISTRIPS } |
An enumeration of the geometric mesh primitives. More... | |
Public Member Functions | |
SubMesh () | |
Constructor. | |
virtual | ~SubMesh () |
Destructor. | |
void | AddIndex (unsigned int _i) |
Add an index to the mesh. | |
void | AddNodeAssignment (unsigned int _vertex, unsigned int _node, float _weight) |
Add a vertex - skeleton node assignment. | |
void | AddNormal (const math::Vector3 &_n) |
Add a normal to the mesh. | |
void | AddNormal (double _x, double _y, double _z) |
Add a normal to the mesh. | |
void | AddTexCoord (double _u, double _v) |
Add a texture coord to the mesh. | |
void | AddVertex (const math::Vector3 &_v) |
Add a vertex to the mesh. | |
void | AddVertex (double _x, double _y, double _z) |
Add a vertex to the mesh. | |
void | CopyNormals (const std::vector< math::Vector3 > &_norms) |
Copy normals from a vector. | |
void | CopyVertices (const std::vector< math::Vector3 > &_verts) |
Copy vertices from a vector. | |
void | FillArrays (float **_vertArr, int **_indArr) const |
Put all the data into flat arrays. | |
void | GenSphericalTexCoord (const math::Vector3 &_center) |
Generate texture coordinates using spherical projection from center. | |
unsigned int | GetIndex (unsigned int _i) const |
Get an index. | |
unsigned int | GetIndexCount () const |
Return the number of indicies. | |
unsigned int | GetMaterialIndex () const |
Get the material index. | |
math::Vector3 | GetMax () const |
Get the maximun X, Y, Z values. | |
unsigned int | GetMaxIndex () const |
Get the highest index value. | |
math::Vector3 | GetMin () const |
Get the minimum X, Y, Z values. | |
NodeAssignment | GetNodeAssignment (unsigned int _i) const |
Get a vertex - skeleton node assignment. | |
unsigned int | GetNodeAssignmentsCount () const |
Return the number of vertex - skeleton node assignments. | |
math::Vector3 | GetNormal (unsigned int _i) const |
Get a normal. | |
unsigned int | GetNormalCount () const |
Return the number of normals. | |
PrimitiveType | GetPrimitiveType () const |
Get the primitive type. | |
math::Vector2d | GetTexCoord (unsigned int _i) const |
Get a tex coord. | |
unsigned int | GetTexCoordCount () const |
Return the number of texture coordinates. | |
math::Vector3 | GetVertex (unsigned int _i) const |
Get a vertex. | |
unsigned int | GetVertexCount () const |
Return the number of vertices. | |
unsigned int | GetVertexIndex (const math::Vector3 &_v) const |
Get the index of the vertex. | |
bool | HasVertex (const math::Vector3 &_v) const |
Return true if this submesh has the vertex. | |
void | RecalculateNormals () |
Recalculate all the normals. | |
void | Scale (double _factor) |
Scale all vertices by _factor. | |
void | SetIndexCount (unsigned int _count) |
Resize the index array. | |
void | SetMaterialIndex (unsigned int _index) |
Set the material index. | |
void | SetNormal (unsigned int _i, const math::Vector3 &_n) |
Set a normal. | |
void | SetNormalCount (unsigned int _count) |
Resize the normal array. | |
void | SetPrimitiveType (PrimitiveType _type) |
Set the primitive type. | |
void | SetScale (const math::Vector3 &_factor) |
Scale all vertices by the _factor vector. | |
void | SetSubMeshCenter (math::Vector3 _center) |
Reset mesh center to geometric center. | |
void | SetTexCoord (unsigned int _i, const math::Vector2d &_t) |
Set a tex coord. | |
void | SetTexCoordCount (unsigned int _count) |
Resize the texture coordinate array. | |
void | SetVertex (unsigned int _i, const math::Vector3 &_v) |
Set a vertex. | |
void | SetVertexCount (unsigned int _count) |
Resize the vertex array. | |
A child mesh.
gazebo::common::SubMesh::SubMesh | ( | ) |
Constructor.
|
virtual |
Destructor.
void gazebo::common::SubMesh::AddIndex | ( | unsigned int | _i | ) |
Add an index to the mesh.
[in] | _i | the new vertex index |
void gazebo::common::SubMesh::AddNodeAssignment | ( | unsigned int | _vertex, |
unsigned int | _node, | ||
float | _weight | ||
) |
Add a vertex - skeleton node assignment.
[in] | _vertex | the vertex index |
[in] | _node | the node index |
[in] | _weight | the weight (between 0 and 1) |
void gazebo::common::SubMesh::AddNormal | ( | const math::Vector3 & | _n | ) |
Add a normal to the mesh.
[in] | _n | the normal |
void gazebo::common::SubMesh::AddNormal | ( | double | _x, |
double | _y, | ||
double | _z | ||
) |
Add a normal to the mesh.
[in] | _x | position along x |
[in] | _y | position along y |
[in] | _z | position along z |
void gazebo::common::SubMesh::AddTexCoord | ( | double | _u, |
double | _v | ||
) |
Add a texture coord to the mesh.
[in] | _u | position along u |
[in] | _v | position along v |
void gazebo::common::SubMesh::AddVertex | ( | const math::Vector3 & | _v | ) |
Add a vertex to the mesh.
[in] | _v | the new position |
void gazebo::common::SubMesh::AddVertex | ( | double | _x, |
double | _y, | ||
double | _z | ||
) |
Add a vertex to the mesh.
[in] | _x | position along x |
[in] | _y | position along y |
[in] | _z | position along z |
void gazebo::common::SubMesh::CopyNormals | ( | const std::vector< math::Vector3 > & | _norms | ) |
Copy normals from a vector.
[in] | _norms | to copy from |
void gazebo::common::SubMesh::CopyVertices | ( | const std::vector< math::Vector3 > & | _verts | ) |
Copy vertices from a vector.
[in] | _verts | the vertices to copy from |
void gazebo::common::SubMesh::FillArrays | ( | float ** | _vertArr, |
int ** | _indArr | ||
) | const |
Put all the data into flat arrays.
[in] | _verArr | |
[in] | _indArr |
void gazebo::common::SubMesh::GenSphericalTexCoord | ( | const math::Vector3 & | _center | ) |
Generate texture coordinates using spherical projection from center.
[in] | _center |
unsigned int gazebo::common::SubMesh::GetIndex | ( | unsigned int | _i | ) | const |
Get an index.
[in] | _i |
unsigned int gazebo::common::SubMesh::GetIndexCount | ( | ) | const |
Return the number of indicies.
unsigned int gazebo::common::SubMesh::GetMaterialIndex | ( | ) | const |
Get the material index.
math::Vector3 gazebo::common::SubMesh::GetMax | ( | ) | const |
Get the maximun X, Y, Z values.
unsigned int gazebo::common::SubMesh::GetMaxIndex | ( | ) | const |
Get the highest index value.
math::Vector3 gazebo::common::SubMesh::GetMin | ( | ) | const |
Get the minimum X, Y, Z values.
NodeAssignment gazebo::common::SubMesh::GetNodeAssignment | ( | unsigned int | _i | ) | const |
Get a vertex - skeleton node assignment.
[in] | _i | the index of the assignment |
unsigned int gazebo::common::SubMesh::GetNodeAssignmentsCount | ( | ) | const |
Return the number of vertex - skeleton node assignments.
math::Vector3 gazebo::common::SubMesh::GetNormal | ( | unsigned int | _i | ) | const |
Get a normal.
[in] | _i | the normal index |
unsigned int gazebo::common::SubMesh::GetNormalCount | ( | ) | const |
Return the number of normals.
PrimitiveType gazebo::common::SubMesh::GetPrimitiveType | ( | ) | const |
Get the primitive type.
math::Vector2d gazebo::common::SubMesh::GetTexCoord | ( | unsigned int | _i | ) | const |
Get a tex coord.
[in] | _i | the texture index |
unsigned int gazebo::common::SubMesh::GetTexCoordCount | ( | ) | const |
Return the number of texture coordinates.
math::Vector3 gazebo::common::SubMesh::GetVertex | ( | unsigned int | _i | ) | const |
Get a vertex.
[in] | _i | the vertex index |
unsigned int gazebo::common::SubMesh::GetVertexCount | ( | ) | const |
Return the number of vertices.
unsigned int gazebo::common::SubMesh::GetVertexIndex | ( | const math::Vector3 & | _v | ) | const |
Get the index of the vertex.
[in] | _v |
bool gazebo::common::SubMesh::HasVertex | ( | const math::Vector3 & | _v | ) | const |
Return true if this submesh has the vertex.
[in] | _v |
void gazebo::common::SubMesh::RecalculateNormals | ( | ) |
Recalculate all the normals.
void gazebo::common::SubMesh::Scale | ( | double | _factor | ) |
Scale all vertices by _factor.
[in] | _factor | Scaling factor |
void gazebo::common::SubMesh::SetIndexCount | ( | unsigned int | _count | ) |
Resize the index array.
[in] | _count | the new size of the array |
void gazebo::common::SubMesh::SetMaterialIndex | ( | unsigned int | _index | ) |
Set the material index.
Relates to the parent mesh material list
[in] | _index |
void gazebo::common::SubMesh::SetNormal | ( | unsigned int | _i, |
const math::Vector3 & | _n | ||
) |
Set a normal.
[in] | _i | the normal index |
[in] | _n | the normal direction |
void gazebo::common::SubMesh::SetNormalCount | ( | unsigned int | _count | ) |
Resize the normal array.
[in] | _count | the new size of the array |
void gazebo::common::SubMesh::SetPrimitiveType | ( | PrimitiveType | _type | ) |
Set the primitive type.
[in] | _type | the type |
void gazebo::common::SubMesh::SetScale | ( | const math::Vector3 & | _factor | ) |
Scale all vertices by the _factor vector.
[in] | _factor | Scaling vector |
void gazebo::common::SubMesh::SetSubMeshCenter | ( | math::Vector3 | _center | ) |
Reset mesh center to geometric center.
[in] | _center |
void gazebo::common::SubMesh::SetTexCoord | ( | unsigned int | _i, |
const math::Vector2d & | _t | ||
) |
Set a tex coord.
[in] | _i | |
[in] | _t |
void gazebo::common::SubMesh::SetTexCoordCount | ( | unsigned int | _count | ) |
Resize the texture coordinate array.
[in] | _count |
void gazebo::common::SubMesh::SetVertex | ( | unsigned int | _i, |
const math::Vector3 & | _v | ||
) |
Set a vertex.
[in] | _i | the index |
[in] | _v | the position |
void gazebo::common::SubMesh::SetVertexCount | ( | unsigned int | _count | ) |
Resize the vertex array.
[in] | _count | the new size of the array |