Mesh Class Reference

Mesh objects register all the appropriate buffers into our tracer, and keep an instanced abstraction that results useful for reference or any other specific operation that needs to remember what belongs to whom (Inside our raytracer all we have are triangles, so its useful to keep the object abstraction outside). More...

#include <ecmesh.h>

Inheritance diagram for Mesh:

EclipseObject

List of all members.

Public Member Functions

 Mesh (const char *a_sID, Buffer *a_pVertexBuffer, unsigned int a_nVertexOffset, unsigned int a_nVertexCount, Buffer *a_pUVBuffer, unsigned int a_nUVOffset, unsigned int a_nUVCount, Buffer *a_pIndexBuffer, unsigned int a_nIndexOffset, unsigned int a_nTriangleCount, Scene *a_pScene, Material *a_pMaterial, Matrix *a_pMatrix=NULL)
 Creates a new mesh object The vertex offset and vertex count numbers are applied to the UV buffer as well, meaning that the vertex buffer and the uv buffer MUST have a one-to-one correspondance.
YRTriangleObjectGetYRTrimesh ()
 Returns the actual yafaray mesh.
virtual PYOBJECT PyAsString ()
 Python text representation method This function must be implemented by all children.

Static Public Member Functions

static bool PyTypeCheck (PYOBJECT a_pObject)
 Python type check Verifies that the provided python object encapsulates a mesh.

Protected Member Functions

 ~Mesh ()
 Only we can destroy ourselves.
virtual void DeleteObject ()
 Child message hook for reference-count based destruction.


Detailed Description

Mesh objects register all the appropriate buffers into our tracer, and keep an instanced abstraction that results useful for reference or any other specific operation that needs to remember what belongs to whom (Inside our raytracer all we have are triangles, so its useful to keep the object abstraction outside).

Defines the base mesh object.

Author:
Dan Torres 2008/12/16

Definition at line 50 of file ecmesh.h.


Constructor & Destructor Documentation

Mesh::Mesh ( const char *  a_sID,
Buffer a_pVertexBuffer,
unsigned int  a_nVertexOffset,
unsigned int  a_nVertexCount,
Buffer a_pUVBuffer,
unsigned int  a_nUVOffset,
unsigned int  a_nUVCount,
Buffer a_pIndexBuffer,
unsigned int  a_nIndexOffset,
unsigned int  a_nTriangleCount,
Scene a_pScene,
Material a_pMaterial,
Matrix a_pMatrix = NULL 
)

Creates a new mesh object The vertex offset and vertex count numbers are applied to the UV buffer as well, meaning that the vertex buffer and the uv buffer MUST have a one-to-one correspondance.

Parameters:
a_sID Unique mesh ID
a_pVertexBuffer A buffer containing all required vertices
a_nVertexOffset Offset (in number of vertices) for use when reading from the vertex buffer
a_nVertexCount Number of vertices to read from the vertex buffer
a_pUVBuffer A buffer containing a set of UV coordinates per vertex
a_nUVOffset Offset (in number of UV pairs) for accessing our uv buffer
a_nUVCount Number of UV components to read from the buffer
a_pIndexBuffer A buffer for a triangle list, containing 6 indexes per face (3 vert + 3 uv )
a_nIndexOffset Offset (in number of components) into the index buffer
a_nTriangleCount Number of triangles to include. This determines the number of indexes to read (6 per triangle)
a_pScene A valid scene for this mesh to live in
a_pMaterial A valid material for this mesh to have
a_pMatrix An optional transformation matrix to apply over the vertex buffer


Member Function Documentation

virtual void Mesh::DeleteObject (  )  [protected, virtual]

Child message hook for reference-count based destruction.

The child class is responsible for deleting any instance to which this this function is called.

Reimplemented from EclipseObject.

virtual PYOBJECT Mesh::PyAsString (  )  [virtual]

Python text representation method This function must be implemented by all children.

Returns:
A python string object with a description of ourselves

Reimplemented from EclipseObject.

static bool Mesh::PyTypeCheck ( PYOBJECT  a_pObject  )  [static]

Python type check Verifies that the provided python object encapsulates a mesh.

Returns:
True if the provided object type is the same as ours

Reimplemented from EclipseObject.


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

Generated on Tue Jan 20 17:57:58 2009 for EclipseRay by  doxygen 1.5.7.1