3ds Max C++ API Reference
HWVertexBuffer Class Reference

This is a class that lets you create a hw vertex buffer. More...

#include <HWVertex.h>

+ Inheritance diagram for HWVertexBuffer:

Public Member Functions

DllExport HWVertexBuffer (DWORD vType)
 Constructor. More...
 
DllExport ~HWVertexBuffer ()
 Destructor. More...
 
DllExport void FreeBuffer ()
 Frees the vertex buffer. More...
 
DllExport void SetUVWSize (unsigned int id, unsigned int size)
 This sets the size of each UVW channel. More...
 
DllExport void SetMaxMapChannel (unsigned int hwChannel, int maxMapChannel)
 This lets you associate a HW texture channel with a max map channel. More...
 
DllExport int GetMaxMapChannel (unsigned int hwChannel)
 This lets get the map channel associated with a hw channel. More...
 
DllExport bool CreateBuffer (unsigned int numVertice)
 This allocates our buffer. Returns false if the buffer creation failed. More...
 
DllExport unsigned int GetStride ()
 returns the stride in bytes of a hw vertex More...
 
DllExport unsigned int Size ()
 returns the size in bytes of the entire buffer More...
 
DllExport unsigned int NumberVertices ()
 returns the number of hw vertices in the buffer More...
 
DllExport bool SetNumberVertices (unsigned int ct)
 this lets you set the size of the buffer, More...
 
DllExport HWVertex GetHWVert (int id)
 This returns a hwvertex of a specific vertex. More...
 
DllExport BYTE * GetRawBufferPointer ()
 returns a raw pointer to the vertex buffer More...
 
DllExport void SetHasConnectionData (bool hasConnectionData)
 This lets you set whether the vertex buffer will also maintain a connection list back to the original geometry. More...
 
DllExport bool GetHasConnectionData ()
 This returns whether the vertex buffer has connection data back to the original geometry. More...
 
DllExport void SetConnectionData (unsigned int i, unsigned int oldPosID, int oldNormalID)
 This lets you set the connection data. More...
 
DllExport unsigned intGetPositionConnectionList ()
 This returns position mapping list. More...
 
DllExport intGetNormalConnectionList ()
 This returns normal mapping list. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator 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 voidoperator 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 voidoperator 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 voidoperator 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 voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_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...
 

Detailed Description

This is a class that lets you create a hw vertex buffer.

It allows you to define, create, edit and access the buffer

Constructor & Destructor Documentation

◆ HWVertexBuffer()

DllExport HWVertexBuffer ( DWORD  vType)

Constructor.

Parameters
[in]vTypethe description of the HW vertex which can be any combination of VertexType

◆ ~HWVertexBuffer()

Destructor.

Member Function Documentation

◆ FreeBuffer()

DllExport void FreeBuffer ( )

Frees the vertex buffer.

◆ SetUVWSize()

DllExport void SetUVWSize ( unsigned int  id,
unsigned int  size 
)

This sets the size of each UVW channel.

By default a UVW channel is 2 point3 a UV. you can change the size to just a U, UV, or UVW with this. This must be set before calling create buffer if you want to change the channel sizes

Parameters
[in]idwhich channel
[in]sizethe size of the channel 1 to 3

◆ SetMaxMapChannel()

DllExport void SetMaxMapChannel ( unsigned int  hwChannel,
int  maxMapChannel 
)

This lets you associate a HW texture channel with a max map channel.

Parameters
[in]hwChannelthe hw channel
[in]maxMapChannelthe Max channel

◆ GetMaxMapChannel()

DllExport int GetMaxMapChannel ( unsigned int  hwChannel)

This lets get the map channel associated with a hw channel.

Parameters
[in]hwChannelthe hw channel

◆ CreateBuffer()

DllExport bool CreateBuffer ( unsigned int  numVertice)

This allocates our buffer. Returns false if the buffer creation failed.

Parameters
[in]numVerticeis the number of hw vertices to create for this buffer
Returns
true is succeeded, false if failed typically an out of mememory error

◆ GetStride()

DllExport unsigned int GetStride ( )

returns the stride in bytes of a hw vertex

◆ Size()

DllExport unsigned int Size ( )
inline

returns the size in bytes of the entire buffer

◆ NumberVertices()

DllExport unsigned int NumberVertices ( )
inline

returns the number of hw vertices in the buffer

◆ SetNumberVertices()

DllExport bool SetNumberVertices ( unsigned int  ct)

this lets you set the size of the buffer,

this lets you set the size of the buffer, it returns true if everything was allocated correctly
/param unsigned int ct the number of vertices to set the buffer count to

◆ GetHWVert()

DllExport HWVertex GetHWVert ( int  id)
inline

This returns a hwvertex of a specific vertex.

Parameters
[in]idis which vertex you want to look at

◆ GetRawBufferPointer()

DllExport BYTE* GetRawBufferPointer ( )

returns a raw pointer to the vertex buffer

◆ SetHasConnectionData()

DllExport void SetHasConnectionData ( bool  hasConnectionData)

This lets you set whether the vertex buffer will also maintain a connection list back to the original geometry.

Parameters
[in]hasConnectionDatawhether the vertex buffer will also build connection info from the max mesh to the HW mesh

◆ GetHasConnectionData()

DllExport bool GetHasConnectionData ( )

This returns whether the vertex buffer has connection data back to the original geometry.

◆ SetConnectionData()

DllExport void SetConnectionData ( unsigned int  i,
unsigned int  oldPosID,
int  oldNormalID 
)

This lets you set the connection data.

This lets you set the connection data. It only tracks position and normals.

Parameters
[in]ithis is the index in the hw vertex buffer
[in]oldPosIDthis is the position index in max mesh vertex list
[in]oldNormalIDthis is the position index in max mesh gfxnormal list, set this value if you want to use the gfxfacenormal list. This is used when the face has no smoothing group

◆ GetPositionConnectionList()

DllExport unsigned int* GetPositionConnectionList ( )

This returns position mapping list.

◆ GetNormalConnectionList()

DllExport int* GetNormalConnectionList ( )

This returns normal mapping list.