csTriangleMesh Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes
csTriangleMesh Class Reference
Geometry utilities

A mesh of triangles. More...

`#include <csgeom/trimesh.h>`

Inheritance diagram for csTriangleMesh:

List of all members.

## Public Member Functions
void | AddTriangle (int a, int b, int c)
| Add a triangle to the mesh.
void | AddTriangleMesh (const csTriangleMesh &tm)
| Add another triangle mesh to this one.
void | AddVertex (const csVector3 &v)
| Add a vertex to the mesh.
void | Clear ()
| Clear the mesh of triangles.
virtual uint32 | GetChangeNumber () const
| When this number changes you know the triangle mesh has changed (deformation has occured) since the last time you got another number from this function.
virtual csFlags & | GetFlags ()
| Get flags for this triangle mesh.
size_t | GetTriangleCount () const
| Query the number of triangles.
virtual size_t | GetTriangleCount ()
| Query the number of triangles.
virtual csTriangle * | GetTriangles ()
| Query the array of triangles.
const csTriangle * | GetTriangles () const
| Query the array of triangles.
virtual size_t | GetVertexCount ()
| Get the number of vertices for this mesh.
size_t | GetVertexCount () const
| Get the number of vertices for this mesh.
virtual csVector3 * | GetVertices ()
| Get the pointer to the array of vertices.
const csVector3 * | GetVertices () const
| Get the pointer to the array of vertices.
virtual void | Lock ()
| Lock the triangle mesh.
csTriangleMesh & | operator+= (const csTriangleMesh &tm)
| Adds another triangle mesh to this one.
void | SetSize (int count)
| Set the size of the triangle list.
void | SetTriangles (csTriangle const *trigs, int count)
| Set the triangle array. The array is copied.
virtual void | Unlock ()
| Unlock the triangle mesh.
## Protected Attributes
csDirtyAccessArray< csTriangle > | triangles
| The triangles.

## Detailed Description

A mesh of triangles.

Note that a mesh of triangles is only valid if used in combination with a vertex or edge table. Every triangle is then a set of three indices in that table.

Definition at line 45 of file trimesh.h.

## Member Function Documentation

void csTriangleMesh::AddTriangle | ( | int | a,
|  | int | b,
|  | int | c
| ) |  |

Add a triangle to the mesh.

void csTriangleMesh::AddTriangleMesh | ( | const csTriangleMesh & | tm | ) |

Add another triangle mesh to this one.

void csTriangleMesh::AddVertex | ( | const csVector3 & | v | ) |

Add a vertex to the mesh.

void csTriangleMesh::Clear | ( |  | ) |

Clear the mesh of triangles.

virtual uint32 csTriangleMesh::GetChangeNumber | ( |  | ) | const`[inline, virtual]`

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

Implements iTriangleMesh.

Definition at line 101 of file trimesh.h.

virtual csFlags& csTriangleMesh::GetFlags | ( |  | ) | `[inline, virtual]`

Get flags for this triangle mesh.

This is zero or a combination of the following flags:

- CS_TRIMESH_CLOSED: mesh is closed.
- CS_TRIMESH_NOTCLOSED: mesh is not closed.
- CS_TRIMESH_CONVEX: mesh is convex.
- CS_TRIMESH_NOTCONVEX: mesh is not convex.
- CS_TRIMESH_DEFORMABLE: mesh is deformable.

Note that if neither CS_TRIMESH_CLOSED nor CS_TRIMESH_NOTCLOSED are set then the closed state is not known. Setting both is illegal. Note that if neither CS_TRIMESH_CONVEX nor CS_TRIMESH_NOTCONVEX are set then the convex state is not known. Setting both is illegal.

Implements iTriangleMesh.

Definition at line 100 of file trimesh.h.

size_t csTriangleMesh::GetTriangleCount | ( |  | ) | const`[inline]`

Query the number of triangles.

Definition at line 87 of file trimesh.h.

virtual size_t csTriangleMesh::GetTriangleCount | ( |  | ) | `[inline, virtual]`

Query the number of triangles.

Implements iTriangleMesh.

Definition at line 89 of file trimesh.h.

virtual csTriangle* csTriangleMesh::GetTriangles | ( |  | ) | `[inline, virtual]`

Query the array of triangles.

Implements iTriangleMesh.

Definition at line 81 of file trimesh.h.

const csTriangle* csTriangleMesh::GetTriangles | ( |  | ) | const`[inline]`

Query the array of triangles.

Definition at line 83 of file trimesh.h.

virtual size_t csTriangleMesh::GetVertexCount | ( |  | ) | `[inline, virtual]`

Get the number of vertices for this mesh.

Implements iTriangleMesh.

Definition at line 68 of file trimesh.h.

size_t csTriangleMesh::GetVertexCount | ( |  | ) | const`[inline]`

Get the number of vertices for this mesh.

Definition at line 70 of file trimesh.h.

virtual csVector3* csTriangleMesh::GetVertices | ( |  | ) | `[inline, virtual]`

Get the pointer to the array of vertices.

Implements iTriangleMesh.

Definition at line 72 of file trimesh.h.

const csVector3* csTriangleMesh::GetVertices | ( |  | ) | const`[inline]`

Get the pointer to the array of vertices.

Definition at line 74 of file trimesh.h.

virtual void csTriangleMesh::Lock | ( |  | ) | `[inline, virtual]`

Lock the triangle mesh.

This prevents the triangle data from being cleaned up.

Implements iTriangleMesh.

Definition at line 98 of file trimesh.h.

csTriangleMesh& csTriangleMesh::operator+= | ( | const csTriangleMesh & | tm | ) |

Adds another triangle mesh to this one.

void csTriangleMesh::SetSize | ( | int | count | ) |

Set the size of the triangle list.

void csTriangleMesh::SetTriangles | ( | csTriangle const * | trigs,
|  | int | count
| ) |  |

Set the triangle array. The array is copied.

virtual void csTriangleMesh::Unlock | ( |  | ) | `[inline, virtual]`

Unlock the triangle mesh.

This allows clean up again.

Implements iTriangleMesh.

Definition at line 99 of file trimesh.h.

## Member Data Documentation

csDirtyAccessArray<csTriangle> csTriangleMesh::triangles`[protected]`

The triangles.

Definition at line 50 of file trimesh.h.

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

- csgeom/trimesh.h