Interface to Alias meshes.
#include <AlMesh.h>
class AlMesh : public AlObject
AlMesh();
virtual ~AlMesh();
virtual statusCode deleteObject();
virtual AlObject* copyWrapper() const;
virtual AlObjectType type() const;
AlMeshNode* meshNode() const;
statusCode create( int numVertices, const float* vertices,
int numTriangles, const int* triangles,
const float* normals = 0,
const float* uvs = 0);
int numberOfVertices() const;
int numberOfTriangles() const;
const float* vertices() const;
const int* triangles() const;
const float* normals() const;
const float* uvs() const;
void uvRange( float* ) const;
statusCode setUVRange( float * );
int drawFlag() const;
API_BOOLEAN isDrawFlag( int ) const;
statusCode setDrawFlag( int, bool );
statusCode setDrawFlag( int );
API_BOOLEAN isFlatShaded() const;
statusCode setFlatShaded( bool );
float* affectedVertices( const AlTM& tm );
float* affectedNormals( const AlTM& tm );
statusCode removeDuplicateTris();
statusCode compact();
statusCode transform( double [4][4] ) const;
statusCode boundingBox( double *min, double *max ) const;
AlShader* firstShader() const;
AlShader* nextShader( AlShader* ) const;
statusCode nextShaderD( AlShader *) const;
statusCode assignShader( AlShader* );
statusCode layerShader( AlShader* );
statusCode renderInfo( AlRenderInfo& ) const;
statusCode setRenderInfo( const AlRenderInfo& ) const;
AlMesh is the interface to meshes and their data in Alias. This class lets a developer create and manipulate mesh objects. Data access methods to all properties are provided. The following properties are used throughout the mesh class.
Vertices are passed by this class using an array of floating point values. A vertex consists of three values; x,y,z respectively. Refer to the definition of triangles for a description of the relationship between vertices and triangles.
The number of vertices is equivalent to the number of x,y,z triplets stored in the vertices array. The total number of floats in the vertices array is equivalent to three times the number of vertices.
Triangles are passed by this class using an array of integer values. A triangle consists of three integer indices. These indices reference a vertex in the vertices array such that vertices[3*index] returns the x coordinate of the vertex. Similarly, vertices[3*index+1] and vertices[3*index+2] return the y and z coordinate respectively. Indices are to be specified in counter clockwise order relative to the front of their face.
The number of triangles is equivalent to the number of integer triplets stored in the triangles array. The total number of integers in the triangles array is equivalent to three times the number of triangles.
Normals are passed by this class using an array of floating point values. They consist of three values; x,y,z respectively. Normals are per vertex. They are referenced by triangles in the same manner that vertices are referenced.
UVs are passed by this class using an array of float values. They consist of two floating point values; u,v respectively. UVs are per vertex. They are referenced by triangles in the same manner that vertices are referenced.
statusCode AlMesh::create( int numVertices, const float* vertices, int numTriangles, const int* triangles, const float* normals, const float* uvs)
Creates a mesh object with the supplied data. The user This is expected to allocate memory and seed data for the various arrays. Refer to the description of this class for detailed information on the arguments passed. Passing a uv array is optional. Passing a normal array is optional. Note that normals are recalculated as the mesh is changed.
statusCode AlMesh::boundingBox( double *min, double *max ) const