QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Q::Mesh Struct Reference
[Geometric Objects]

A geometry object for rendering static triangle meshes. More...

#include <Q/q.h>

Inheritance diagram for Q::Mesh:

Q::Geom Q::Object Q::ObjectBase List of all members.

Public Member Functions

 Mesh ()
 Mesh (const char *name)
unsigned int vertexCount () const
unsigned int triangleCount () const
unsigned int wedgeCount () const
bool collideable () const
Utils::Result setCollideable (bool b)
TriangleIterator triangles ()
VertexIterator vertices ()
WedgeIterator wedges ()
Utils::Result addBox (Maths::Box3f box, const Shader &s) const
Utils::Result addRod (const Maths::Vec3f &start, const Maths::Vec3f &end, float radius, const Shader &s) const

Static Public Member Functions

Mesh create (const char *name, const Database &db=Database())
Mesh find (const char *name)
ClassType classType ()
Mesh cast (const ObjectBase &)

Detailed Description

A geometry object for rendering static triangle meshes.

A Mesh object is a rigid collection of polygons. It contains vertices representing the positions of the triangles, wedges representing the color and texture-coordinates of the triangles and a list of the triangles themselves. Access to these lists is through their respective iterators.


Constructor & Destructor Documentation

Q::Mesh::Mesh  )  [inline]
 

Create a null mesh reference.

Q::Mesh::Mesh const char *  name  ) 
 

Search the currently attached databases for a mesh with the given name.


Member Function Documentation

Utils::Result Q::Mesh::addBox Maths::Box3f  box,
const Shader s
const
 

Add an axis-aligned box using the shader s to the mesh.

Utils::Result Q::Mesh::addRod const Maths::Vec3f start,
const Maths::Vec3f end,
float  radius,
const Shader s
const
 

Add an approximation of a cylinder of radius radius starting at start and ending at end using the shader s to the mesh.

Mesh Q::Mesh::cast const ObjectBase  )  [static]
 

If the object referenced by obj is a mesh, then return a suitable Mesh reference to the object.

Note:
Casting this object will cause it to be loaded from the database if it is not currently resident.

Reimplemented from Q::Geom.

ClassType Q::Mesh::classType  )  [static]
 

Return the type for this class

bool Q::Mesh::collideable  )  const
 

Return true if this mesh is collideable. Only collideable meshes can generate collision events. This is actually a logical-or of the values returned by Geom::collidee, Geom::collider and Geom::boundsEvent.

Mesh Q::Mesh::create const char *  name,
const Database db = Database()
[static]
 

Create a new mesh named name in the given database, db, (or the most recently attached read-write database if db is null). The values of the new object's visible, intersectable, collidee, collider, boundsEvent and lightable flags are set to true.

Mesh Q::Mesh::find const char *  name  )  [static]
 

Search the currently attached databases for a mesh with the given name and return that object, if it exists.

Utils::Result Q::Mesh::setCollideable bool  b  ) 
 

Set the collidability properties (i.e. collidee and collider) of the mesh based on the value of b.

Warning:
This method has no effect.

unsigned int Q::Mesh::triangleCount  )  const
 

Return the number of triangles in the mesh.

TriangleIterator Q::Mesh::triangles  ) 
 

Return an iterator that can be used to examine and edit the triangles for a mesh.

unsigned int Q::Mesh::vertexCount  )  const
 

Return the number of vertices in the mesh.

VertexIterator Q::Mesh::vertices  ) 
 

Return an iterator that can be used to examine and edit the vertices for a mesh.

unsigned int Q::Mesh::wedgeCount  )  const
 

Return the number of wedges in the mesh.

WedgeIterator Q::Mesh::wedges  ) 
 

Return an iterator that can be used to examine and edit the wedges for a mesh.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004