3ds Max C++ API Reference
|
This class is used to help with managing hardware(hw) vertex buffer. More...
#include <HWVertex.h>
Public Member Functions | |
DllExport | HWVertex (DWORD vType) |
Constructor. More... | |
DllExport | HWVertex () |
DllExport | ~HWVertex () |
DllExport void | SetVertexType (DWORD vType) |
Lets you set the vertex type ie whether it is just a pos, pos+normal, pos+normal+UVW0 etc. More... | |
DllExport DWORD | GetVertexType () |
Lets you get the vertex type. More... | |
DllExport void | SetUVWSize (unsigned int id, unsigned int size) |
This sets the size of each UVW channel. More... | |
DllExport unsigned int | GetUVWSize (unsigned int id) |
This gets the size of a specific UVW channel. More... | |
DllExport void | SetBuffer (BYTE *vertexBuffer) |
This lets you map the hw vertex to a buffer. More... | |
DllExport unsigned int | GetStride () |
Returns the stride of the hw vertex in bytes. More... | |
DllExport Point3 | GetPos () |
Gets the Position component if there is one More... | |
DllExport void | SetPos (Point3 p) |
Sets the Position component if there is one. More... | |
DllExport Point3 * | GetPosPtr () |
Returns the pointer to position portion of the vertex More... | |
DllExport Point3 | GetNormal () |
Gets the Normal component if there is one. More... | |
DllExport void | SetNormal (Point3 p) |
Sets the Normal component if there is one. More... | |
DllExport Point3 * | GetNormalPtr () |
Returns the pointer to normal portion of the vertex More... | |
DllExport unsigned int | GetMaxVC () |
Returns the maximum number of supported color channel. More... | |
DllExport DWORD | GetVC (unsigned int id) |
gets the color component if there is one (RBGA byte format) More... | |
DllExport void | SetVC (unsigned int id, DWORD c) |
sets the color component if there is one (RBGA byte format) More... | |
DllExport DWORD * | GetVCPtr (unsigned int id) |
Returns the pointer to vertex color portion of the vertex More... | |
DllExport unsigned int | GetMaxUVW () |
Returns the maximum number of supported UVW/texture channel More... | |
DllExport float * | GetUVW (unsigned int id) |
Gets sets the UVW component if there is one returning *float to the start of the uwv coord. More... | |
DllExport void | SetUVW (unsigned int id, float *uv) |
Sets sets the UVW component if there is one returning *float to the start of the uwv coord. More... | |
DllExport Point3 | GetTangent () |
gets the Tangent component if there is one More... | |
DllExport Point3 * | GetTangentPtr () |
gets the pointer Tangent component if there is one More... | |
DllExport void | SetTangent (Point3 p) |
sets the Tangent component if there is one More... | |
DllExport Point3 | GetBinormal () |
gets the BiNormal component if there is one More... | |
DllExport Point3 * | GetBinormalPtr () |
gets the pointer BiNormal component if there is one More... | |
DllExport void | SetBinormal (Point3 p) |
sets the BiNormal component if there is one More... | |
DllExport void | CopyDataFrom (HWVertex &hwVertSource) |
This lets you copy the vertex data from another vertex. More... | |
DllExport BYTE * | GetRawBufferPointer () |
Returns a raw pointer the vertex buffer 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 used to help with managing hardware(hw) vertex buffer.
It is not designed to be used as representation of an entire vertex buffer but used to map into an existing buffer.
Constructor.
[in] | vType | the description of the HW vertex which can be any combination of VertexType |
Lets you set the vertex type ie whether it is just a pos, pos+normal, pos+normal+UVW0 etc.
[in] | vType | the description of the HW vertex which can be any combination of VertexType |
DllExport DWORD GetVertexType | ( | ) |
Lets you get the vertex type.
This sets the size of each UVW channel.
By default a UVW channel is 2 floats just UV. You can change the size to just a U, UV, or UVW with this. This must be set before accessing any of the vertex data or calling SetBuffer
[in] | id | which channel |
[in] | size | the size of the channel 1 to 3 |
This gets the size of a specific UVW channel.
By default a UVW channel is 2 floats just UV. You can change the size to just a U, UV, or UVW with this.
[in] | id | which channel |
This lets you map the hw vertex to a buffer.
Note you need to call SetUVWSize first before calling this if you want to change the UVW channel sizes
[in] | vertexBuffer | the buffer that you want to map onto |
Sets the Position component if there is one.
[in] | p | the new position value |
Sets the Normal component if there is one.
[in] | p | the new normal value |
gets the color component if there is one (RBGA byte format)
[in] | id | is which channel to get set |
sets the color component if there is one (RBGA byte format)
[in] | id | is which channel to get set |
[in] | c | is the color in RBGA byte format |
Returns the pointer to vertex color portion of the vertex
Gets sets the UVW component if there is one returning *float to the start of the uwv coord.
[in] | id | is which channel to get set |
Sets sets the UVW component if there is one returning *float to the start of the uwv coord.
[in] | id | is which channel to get set |
[in] | uv | the uv data to set |
sets the Tangent component if there is one
[in] | p | the tangent value |
sets the BiNormal component if there is one
[in] | p | the BiNormal value |
This lets you copy the vertex data from another vertex.
[in] | hwVertSource | this is the vertex that you want to copy from |
DllExport BYTE* GetRawBufferPointer | ( | ) |
Returns a raw pointer the vertex buffer