3ds Max C++ API Reference
|
This class is a container for vertex and index buffers. More...
#include <HWMesh.h>
Public Member Functions | |
DllExport | HWTupleMesh (DWORD vertexType) |
Constructor. More... | |
DllExport | ~HWTupleMesh () |
Destructor. More... | |
DllExport unsigned int | Size () |
Returns the size of the buffers in bytes. More... | |
DllExport HWVertexBuffer * | GetHWVertexBuffer () |
This returns the hw vertex buffer for this hw mesh. More... | |
DllExport unsigned int | AddHWIndexBuffer (unsigned int numberPrimitives, PrimitiveType primitive, bool use16Bit) |
This lets you add a index buffer to the mesh. More... | |
DllExport HWIndexBuffer * | GetHWIndexBuffer (unsigned int id) |
This returns a particular index buffer. More... | |
DllExport bool | ReleaseHWIndexBuffer (unsigned int id) |
This lets you delete a particular index buffer. It returns true if successful. More... | |
DllExport unsigned int | GetHWIndexCount () |
This returns the number of index buffers. More... | |
DllExport DWORD | GetMatID () |
This lets you get the material id for this mesh. More... | |
DllExport void | SetMatID (DWORD matID) |
This lets you set the material id for this mesh. More... | |
DllExport void | SetGFXMesh (IHWSubMesh *msh) |
This lets you set the IHWDrawMesh asssociated with this mesh. More... | |
DllExport IHWSubMesh * | GetGFXMesh () |
This lets you get the IHWDrawMesh asssociated with this mesh. More... | |
DllExport void | UpdateVertexBuffer (Point3 *vertexList, Point3 *gfxNormalList, Point3 *faceNormalList, BitArray &changedVerts, int count) |
This allows you to update the buffers. More... | |
Additional Inherited Members | |
![]() | |
static UtilExport void * | operator new (size_t size) |
Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e) |
Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new (size_t size, const char *filename, int line) |
New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, const char *filename, int line) |
New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new (size_t size, unsigned long flags) |
New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, unsigned long flags) |
New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new[] (size_t size) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new[] (size_t size, const char *filename, int line) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate arrays of objects. More... | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void * | operator new[] (size_t size, unsigned long flags) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, unsigned long flags) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More... | |
static UtilExport void | operator delete (void *ptr) |
Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e) |
Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete (void *ptr, const char *filename, int line) |
Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, int block_type, const char *filename, int line) |
Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete (void *ptr, unsigned long flags) |
Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags) |
Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete[] (void *ptr) |
Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e) |
Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete[] (void *ptr, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, int block_type, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More... | |
static UtilExport void | operator delete[] (void *ptr, unsigned long flags) |
Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags) |
Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More... | |
static UtilExport void * | operator new (size_t size, void *placement_ptr) |
Placement new operator. More... | |
static UtilExport void | operator delete (void *ptr, void *placement_ptr) |
Placement delete operator. More... | |
static UtilExport void * | aligned_malloc (size_t size, size_t alignment) |
Allocates memory on a specified alignment boundary. More... | |
static UtilExport void * | aligned_realloc (void *ptr, size_t size, size_t alignment) |
Reallocates memory on a specified alignment boundary. More... | |
static UtilExport void | aligned_free (void *ptr) |
Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More... | |
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.
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 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.
This lets you delete a particular index buffer. It returns true if successful.
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.
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 |