This class is a container for vertex and index buffers.
This class is a container for vertex and index buffers. It represents mesh that has one material on it. It allows you to generate buffers and fill them out. It has one vertex buffer and 2 index buffers, one for the shaded mesh and one for the wire frame.
#include <HWMesh.h>
Public Member Functions |
|
DllExport | HWTupleMesh (DWORD vertexType) |
Constructor. |
|
DllExport | ~HWTupleMesh () |
Destructor. |
|
DllExport unsigned int | Size () |
Returns the size of the buffers in bytes.
|
|
DllExport HWVertexBuffer * | GetHWVertexBuffer () |
This returns the hw vertex buffer for this
hw mesh. |
|
DllExport unsigned int | AddHWIndexBuffer (unsigned int numberPrimitives, PrimitiveType primitive, bool use16Bit) |
This lets you add a index buffer to the
mesh. |
|
DllExport HWIndexBuffer * | GetHWIndexBuffer (unsigned int id) |
This returns a particular index buffer.
|
|
DllExport bool | ReleaseHWIndexBuffer (unsigned int id) |
This lets you delete a particular index
buffer. It returns true if successful. |
|
DllExport unsigned int | GetHWIndexCount () |
This returns the number of index buffers.
|
|
DllExport DWORD | GetMatID () |
This lets you get the material id for this
mesh. |
|
DllExport void | SetMatID (DWORD matID) |
This lets you set the material id for this
mesh. |
|
DllExport void | SetGFXMesh (IHWSubMesh *msh) |
This lets you set the IHWDrawMesh
asssociated with this mesh. |
|
DllExport IHWSubMesh * | GetGFXMesh () |
This lets you get the IHWDrawMesh
asssociated with this mesh. |
|
DllExport void | UpdateVertexBuffer (Point3 *vertexList, Point3 *gfxNormalList, Point3 *faceNormalList, BitArray &changedVerts, int count) |
This allows you to update the buffers.
|
DllExport HWTupleMesh | ( | DWORD | vertexType | ) |
Constructor.
vertexType | is the vertex type ie Pos|Normals|UVWs etc that this mesh will use. See HWVertex.h, enum VertexType for the list of supported types |
DllExport ~HWTupleMesh | ( | ) |
Destructor.
DllExport unsigned int Size | ( | ) |
Returns the size of the buffers in bytes.
DllExport HWVertexBuffer* GetHWVertexBuffer | ( | ) |
This returns the hw vertex buffer for this hw mesh.
Typical usage it to create the mesh. Get the hw vertex buffer, set it parameters, create it, then fill it out.
DllExport unsigned int AddHWIndexBuffer | ( | unsigned int | numberPrimitives, |
PrimitiveType | primitive, | ||
bool | use16Bit | ||
) |
This lets you add a index buffer to the mesh.
We support 2 index buffer per mesh so that different draw primtives can share the same vertex buffer. The first is the shaded face buffer the second is the wire frame line list. It returns the id of this index buffer
numberPrimitives | is the number of primitives ie triangleList, lineList etc for this buffer |
primitive | is the type of primitive it is ie trianglelist, linelist etc. |
use16Bit | is whether the buffer buffer will be 16 bit or 32 bit indices |
DllExport HWIndexBuffer* GetHWIndexBuffer | ( | unsigned int | id | ) |
This returns a particular index buffer.
DllExport bool ReleaseHWIndexBuffer | ( | unsigned int | id | ) |
This lets you delete a particular index buffer. It returns true if successful.
DllExport unsigned int GetHWIndexCount | ( | ) |
This returns the number of index buffers.
DllExport DWORD GetMatID | ( | ) |
This lets you get the material id for this mesh.
This lets you associate the mesh with a material. We only allow one material per mesh.
DllExport void SetMatID | ( | DWORD | matID | ) |
This lets you set the material id for this mesh.
This lets you get the associate material for this mesh. We only allow one material per mesh.
DllExport void SetGFXMesh | ( | IHWSubMesh * | msh | ) |
This lets you set the IHWDrawMesh asssociated with this mesh.
The IHWDrawMesh contains the low level hardware buffers specific to the current device ie Direct9, 10, OGL etc
DllExport IHWSubMesh* GetGFXMesh | ( | ) |
This lets you get the IHWDrawMesh asssociated with this mesh.
The IHWDrawMesh contains the low level hardware buffers specific to the current device ie Direct9, 10, OGL etc
DllExport void UpdateVertexBuffer | ( | Point3 * | vertexList, |
Point3 * | gfxNormalList, | ||
Point3 * | faceNormalList, | ||
BitArray & | changedVerts, | ||
int | count | ||
) |
This allows you to update the buffers.
This allows you to change the position and normals of the mesh without recreating the hwmesh.
vertexList | This is a pointer of all the vertices on the mesh |
gfxNormalList | This is a pointer of all the gfx normals on the mesh |
faceNormalList | This is a pointer of all the face normals on the mesh |
changedVerts | This is a bitarray of the changed verts |
count | This is number of vertices in vertex List |