CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csPolygonMesh Class Reference
[Geometry utilities]

A convenience polygon mesh implementation that you can feed with vertices and polygons from another source. More...

#include <polymesh.h>

Inheritance diagram for csPolygonMesh:

iPolygonMesh iBase List of all members.

Public Methods

 csPolygonMesh ()
 Construct a polygon mesh. More...

void SetVertices (csVector3 *vt, int vt_count, bool delete_vt)
 Set the vertices to use for this polygon mesh. More...

void SetPolygons (csMeshedPolygon *po, int po_count, bool delete_po)
 Set the polygons to use for this polygon mesh. More...

void SetPolygonIndices (int *po_indices, bool delete_po_indices)
 Set polygon indices used by SetPolygons(). More...

void SetPolygonIndexCount (int po_index_count)
 Set polygon index count. More...

int * GetPolygonIndices ()
 Get the polygon index table. More...

void SetVertexCount (int vt_count)
 Set vertex count. More...

void SetPolygonCount (int po_count)
 Set polygon count. More...

void ShapeChanged ()
 Indicate that the shape has changed. More...

virtual int GetVertexCount ()
 Get the number of vertices for this mesh. More...

virtual csVector3GetVertices ()
 Get the pointer to the array of vertices. More...

virtual int GetPolygonCount ()
 Get the number of polygons for this mesh. More...

virtual csMeshedPolygonGetPolygons ()
 Get the pointer to the array of polygons. More...

virtual int GetTriangleCount ()
 Get the number of triangles for this mesh. More...

virtual csTriangleGetTriangles ()
 Get the triangle table for this mesh. More...

virtual void Lock ()
 Lock the polygon mesh. More...

virtual void Unlock ()
 Unlock the polygon mesh. More...

virtual csFlagsGetFlags ()
 Get flags for this polygon mesh. More...

virtual uint32 GetChangeNumber () const
 When this number changes you know the polygon mesh has changed (deformation has occured) since the last time you got another number from this function. More...


Detailed Description

A convenience polygon mesh implementation that you can feed with vertices and polygons from another source.

It will automatically calculate the triangles if requested.

Definition at line 37 of file csgeom/polymesh.h.


Constructor & Destructor Documentation

csPolygonMesh::csPolygonMesh   [inline]
 

Construct a polygon mesh.

Definition at line 65 of file csgeom/polymesh.h.

References SCF_CONSTRUCT_IBASE.


Member Function Documentation

virtual uint32 csPolygonMesh::GetChangeNumber   const [inline, virtual]
 

When this number changes you know the polygon mesh has changed (deformation has occured) since the last time you got another number from this function.

Implements iPolygonMesh.

Definition at line 198 of file csgeom/polymesh.h.

References uint32.

virtual csFlags& csPolygonMesh::GetFlags   [inline, virtual]
 

Get flags for this polygon mesh.

This is zero or more of the following:

Note that if neither CS_POLYMESH_CLOSED nor CS_POLYMESH_NOTCLOSED are set then the closed state is not known. Setting both is illegal. Note that if neither CS_POLYMESH_CONVEX nor CS_POLYMESH_NOTCONVEX are set then the convex state is not known. Setting both is illegal.

Implements iPolygonMesh.

Definition at line 197 of file csgeom/polymesh.h.

virtual int csPolygonMesh::GetPolygonCount   [inline, virtual]
 

Get the number of polygons for this mesh.

Implements iPolygonMesh.

Definition at line 183 of file csgeom/polymesh.h.

int* csPolygonMesh::GetPolygonIndices   [inline]
 

Get the polygon index table.

Definition at line 140 of file csgeom/polymesh.h.

virtual csMeshedPolygon* csPolygonMesh::GetPolygons   [inline, virtual]
 

Get the pointer to the array of polygons.

Implements iPolygonMesh.

Definition at line 184 of file csgeom/polymesh.h.

virtual int csPolygonMesh::GetTriangleCount   [inline, virtual]
 

Get the number of triangles for this mesh.

Implements iPolygonMesh.

Definition at line 185 of file csgeom/polymesh.h.

virtual csTriangle* csPolygonMesh::GetTriangles   [inline, virtual]
 

Get the triangle table for this mesh.

Implements iPolygonMesh.

Definition at line 190 of file csgeom/polymesh.h.

virtual int csPolygonMesh::GetVertexCount   [inline, virtual]
 

Get the number of vertices for this mesh.

Implements iPolygonMesh.

Definition at line 181 of file csgeom/polymesh.h.

virtual csVector3* csPolygonMesh::GetVertices   [inline, virtual]
 

Get the pointer to the array of vertices.

Implements iPolygonMesh.

Definition at line 182 of file csgeom/polymesh.h.

virtual void csPolygonMesh::Lock   [inline, virtual]
 

Lock the polygon mesh.

This prevents the polygon and triangle data from being cleaned up.

Implements iPolygonMesh.

Definition at line 195 of file csgeom/polymesh.h.

void csPolygonMesh::SetPolygonCount int    po_count [inline]
 

Set polygon count.

This will make room for the specified number of polygons so that the user can update them. This class will delete the polygons itself later.

Definition at line 163 of file csgeom/polymesh.h.

References ShapeChanged.

void csPolygonMesh::SetPolygonIndexCount int    po_index_count [inline]
 

Set polygon index count.

This will make room for the specified number of polygon indices so that the user can update them. This class will delete the indices itself later.

Definition at line 132 of file csgeom/polymesh.h.

References ShapeChanged.

void csPolygonMesh::SetPolygonIndices int *    po_indices,
bool    delete_po_indices
[inline]
 

Set polygon indices used by SetPolygons().

Definition at line 120 of file csgeom/polymesh.h.

References ShapeChanged.

void csPolygonMesh::SetPolygons csMeshedPolygon   po,
int    po_count,
bool    delete_po
[inline]
 

Set the polygons to use for this polygon mesh.

If 'delete_po' is true then this class will do the cleanup itself at destruction. Otherwise you have to make sure that the pointer to the polygons remains valid until this object is deleted.

Definition at line 109 of file csgeom/polymesh.h.

References ShapeChanged.

void csPolygonMesh::SetVertexCount int    vt_count [inline]
 

Set vertex count.

This will make room for the specified number of vertices so that the user can update them. This class will delete the vertices itself later.

Definition at line 150 of file csgeom/polymesh.h.

References ShapeChanged.

void csPolygonMesh::SetVertices csVector3   vt,
int    vt_count,
bool    delete_vt
[inline]
 

Set the vertices to use for this polygon mesh.

If 'delete_vt' is true then this class will do the cleanup itself at destruction. Otherwise you have to make sure that the pointer to the vertices remains valid until this object is deleted.

Definition at line 95 of file csgeom/polymesh.h.

References ShapeChanged.

void csPolygonMesh::ShapeChanged   [inline]
 

Indicate that the shape has changed.

Definition at line 174 of file csgeom/polymesh.h.

Referenced by SetPolygonCount, SetPolygonIndexCount, SetPolygonIndices, SetPolygons, SetVertexCount, and SetVertices.

virtual void csPolygonMesh::Unlock   [inline, virtual]
 

Unlock the polygon mesh.

This allows clean up again.

Implements iPolygonMesh.

Definition at line 196 of file csgeom/polymesh.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14