iTriangleMesh Struct 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
iTriangleMesh Struct Reference
Geometry utilities

This interface reprents a mesh of triangles. More...

`#include <igeom/trimesh.h>`

Inheritance diagram for iTriangleMesh:

List of all members.

## Public Member Functions
virtual uint32 | GetChangeNumber () const =0
| 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 ()=0
| Get flags for this triangle mesh.
virtual size_t | GetTriangleCount ()=0
| Get the number of triangles for this mesh.
virtual csTriangle * | GetTriangles ()=0
| Get the triangle table for this mesh.
virtual size_t | GetVertexCount ()=0
| Get the number of vertices for this mesh.
virtual csVector3 * | GetVertices ()=0
| Get the pointer to the array of vertices.
virtual void | Lock ()=0
| Lock the triangle mesh.
virtual void | Unlock ()=0
| Unlock the triangle mesh.

## Detailed Description

This interface reprents a mesh of triangles.

It is useful to communicate geometry information outside of the engine. One place where this will be useful is for communicating geometry information to the collision detection plugin.
All Crystal Space mesh objects (things, sprites, ...) should implement and/or embed an implementation of this interface.

A triangle mesh has the concept of a vertex buffer and an array of triangles.

Main creators of instances implementing this interface:

- Almost all mesh objects have several implementations of this interface.

Main ways to get pointers to this interface:

- iObjectModel::GetTriangleData()

Main users of this interface:

- Collision detection plugins (iCollideSystem)
- Visibility culler plugins (iVisibilityCuller)
- Shadow stencil plugin

Definition at line 112 of file trimesh.h.

## Member Function Documentation

virtual uint32 iTriangleMesh::GetChangeNumber | ( |  | ) | const`[pure 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.

Implemented in csTriangleMeshPointer, csTriangleMeshBox, and csTriangleMesh.

virtual csFlags& iTriangleMesh::GetFlags | ( |  | ) | `[pure 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.

Implemented in csTriangleMeshPointer, csTriangleMeshBox, and csTriangleMesh.

virtual size_t iTriangleMesh::GetTriangleCount | ( |  | ) | `[pure virtual]`

Get the number of triangles for this mesh.

Implemented in csTriangleMeshPointer, csTriangleMeshBox, and csTriangleMesh.

virtual csTriangle* iTriangleMesh::GetTriangles | ( |  | ) | `[pure virtual]`

Get the triangle table for this mesh.

Implemented in csTriangleMeshPointer, csTriangleMeshBox, and csTriangleMesh.

virtual size_t iTriangleMesh::GetVertexCount | ( |  | ) | `[pure virtual]`

Get the number of vertices for this mesh.

Implemented in csTriangleMeshPointer, csTriangleMeshBox, and csTriangleMesh.

virtual csVector3* iTriangleMesh::GetVertices | ( |  | ) | `[pure virtual]`

Get the pointer to the array of vertices.

Implemented in csTriangleMeshPointer, csTriangleMeshBox, and csTriangleMesh.

virtual void iTriangleMesh::Lock | ( |  | ) | `[pure virtual]`

Lock the triangle mesh.

This prevents the triangle data from being cleaned up.

Implemented in csTriangleMeshPointer, csTriangleMeshBox, and csTriangleMesh.

virtual void iTriangleMesh::Unlock | ( |  | ) | `[pure virtual]`

Unlock the triangle mesh.

This allows clean up again.

Implemented in csTriangleMeshPointer, csTriangleMeshBox, and csTriangleMesh.

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

- igeom/trimesh.h