Public Types | Public Member Functions
SubMesh Class Reference

A child mesh. More...

#include <Mesh.hh>

List of all members.

Public Types

enum  PrimitiveType {
  LINES, LINESTRIPS, TRIANGLES, TRIFANS,
  TRISTRIPS
}

Public Member Functions

 SubMesh ()
 Constructor.
virtual ~SubMesh ()
 Destructor.
void SetPrimitiveType (PrimitiveType _type)
 Set the primitive type.
PrimitiveType GetPrimitiveType () const
 Get the primitive type.
void CopyVertices (const std::vector< math::Vector3 > &_verts)
 Copy vertices from a vector.
void CopyNormals (const std::vector< math::Vector3 > &_norms)
 Copy normals from a vector.
void SetVertexCount (unsigned int _count)
 Resize the vertex array.
void SetIndexCount (unsigned int _count)
 Resize the index array.
void SetNormalCount (unsigned int _count)
 Resize the normal array.
void SetTexCoordCount (unsigned int _count)
 Resize the texture coordinate array.
void AddIndex (unsigned int i)
 Add an index 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 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.
math::Vector3 GetVertex (unsigned int i) const
 Get a vertex.
void SetVertex (unsigned int i, const math::Vector3 &v)
 Set a vertex.
math::Vector3 GetNormal (unsigned int i) const
 Get a normal.
void SetNormal (unsigned int i, const math::Vector3 &n)
 Set a normal.
math::Vector2d GetTexCoord (unsigned int i) const
 Get a tex coord.
void SetTexCoord (unsigned int i, const math::Vector2d &t)
 Set a tex coord.
unsigned int GetIndex (unsigned int i) const
 Get an index.
math::Vector3 GetMax () const
 Get the maximun X,Y,Z values.
math::Vector3 GetMin () const
 Get the minimum X,Y,Z values.
unsigned int GetVertexCount () const
 Return the number of vertices.
unsigned int GetNormalCount () const
 Return the number of normals.
unsigned int GetIndexCount () const
 Return the number of indicies.
unsigned int GetTexCoordCount () const
 Return the number of texture coordinates.
unsigned int GetMaxIndex () const
 Get the highest index value.
void SetMaterialIndex (unsigned int index)
 Set the material index. Relates to the parent mesh material list.
unsigned int GetMaterialIndex () const
 Get the material index.
bool HasVertex (const math::Vector3 &v) const
 Return true if this submesh has the vertex.
unsigned int GetVertexIndex (const math::Vector3 &v) const
 Get the index of the vertex.
void FillArrays (float **vertArr, unsigned int **indArr) const
 Put all the data into flat arrays.
void RecalculateNormals ()
 Recalculate all the normals.
void SetSubMeshCenter (math::Vector3 center)
 Reset mesh center to geometric center.
void GenSphericalTexCoord (math::Vector3 center)
 Generate texture coordinates using spherical projection from center.

Detailed Description

A child mesh.


The documentation for this class was generated from the following file: