HWVertex Class Reference

This reference page is linked to from the following overview topics: Hardware Mesh Support.



Detailed Description

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.

#include <HWVertex.h>

Inheritance diagram for HWVertex:
Inheritance graph
[legend]

List of all members.

Public Member Functions

DllExport  HWVertex (DWORD vType)
  Constructor.
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.
DllExport DWORD  GetVertexType ()
  Lets you get the vertex type.
DllExport void  SetUVWSize (unsigned int id, unsigned int size)
  This sets the size of each UVW channel.
DllExport unsigned int  GetUVWSize (unsigned int id)
  This gets the size of a specific UVW channel.
DllExport void  SetBuffer (BYTE *vertexBuffer)
  This lets you map the hw vertex to a buffer.
DllExport unsigned int  GetStride ()
  Returns the stride of the hw vertex in bytes.
DllExport Point3  GetPos ()
  Gets the Position component if there is one.
DllExport void  SetPos (Point3 p)
  Sets the Position component if there is one.
DllExport Point3 GetPosPtr ()
  Returns the pointer to position portion of the vertex.
DllExport Point3  GetNormal ()
  Gets the Normal component if there is one.
DllExport void  SetNormal (Point3 p)
  Sets the Normal component if there is one.
DllExport Point3 GetNormalPtr ()
  Returns the pointer to normal portion of the vertex.
DllExport unsigned int  GetMaxVC ()
  Returns the maximum number of supported color channel.
DllExport DWORD  GetVC (unsigned int id)
  gets the color component if there is one (RBGA byte format)
DllExport void  SetVC (unsigned int id, DWORD c)
  sets the color component if there is one (RBGA byte format)
DllExport DWORD *  GetVCPtr (unsigned int id)
  Returns the pointer to vertex color portion of the vertex.
DllExport unsigned int  GetMaxUVW ()
  Returns the maximum number of supported UVW/texture channel.
DllExport float *  GetUVW (unsigned int id)
  Gets sets the UVW component if there is one returning *float to the start of the uwv coord.
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.
DllExport Point3  GetTangent ()
  gets the Tangent component if there is one
DllExport Point3 GetTangentPtr ()
  gets the pointer Tangent component if there is one
DllExport void  SetTangent (Point3 p)
  sets the Tangent component if there is one
DllExport Point3  GetBinormal ()
  gets the BiNormal component if there is one
DllExport Point3 GetBinormalPtr ()
  gets the pointer BiNormal component if there is one
DllExport void  SetBinormal (Point3 p)
  sets the BiNormal component if there is one
DllExport void  CopyDataFrom (HWVertex &hwVertSource)
  This lets you copy the vertex data from another vertex.
DllExport BYTE *  GetRawBufferPointer ()
  Returns a raw pointer the vertex buffer.

Constructor & Destructor Documentation

DllExport HWVertex ( DWORD  vType )

Constructor.

Parameters:
[in] vType the description of the HW vertex which can be any combination of VertexType
DllExport HWVertex ( )
DllExport ~HWVertex ( )

Member Function Documentation

DllExport void SetVertexType ( DWORD  vType )

Lets you set the vertex type ie whether it is just a pos, pos+normal, pos+normal+UVW0 etc.

Parameters:
[in] vType the description of the HW vertex which can be any combination of VertexType
DllExport DWORD GetVertexType ( )

Lets you get the vertex type.

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

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

Parameters:
[in] id which channel
[in] size the size of the channel 1 to 3
DllExport unsigned int GetUVWSize ( unsigned int  id )

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.

Parameters:
[in] id which channel
DllExport void SetBuffer ( BYTE *  vertexBuffer )

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

Parameters:
[in] vertexBuffer the buffer that you want to map onto
DllExport unsigned int GetStride ( )

Returns the stride of the hw vertex in bytes.

DllExport Point3 GetPos ( )

Gets the Position component if there is one.

DllExport void SetPos ( Point3  p )

Sets the Position component if there is one.

Parameters:
[in] p the new position value
DllExport Point3* GetPosPtr ( )

Returns the pointer to position portion of the vertex.

DllExport Point3 GetNormal ( )

Gets the Normal component if there is one.

DllExport void SetNormal ( Point3  p )

Sets the Normal component if there is one.

Parameters:
[in] p the new normal value
DllExport Point3* GetNormalPtr ( )

Returns the pointer to normal portion of the vertex.

DllExport unsigned int GetMaxVC ( )

Returns the maximum number of supported color channel.

DllExport DWORD GetVC ( unsigned int  id )

gets the color component if there is one (RBGA byte format)

Parameters:
[in] id is which channel to get set
DllExport void SetVC ( unsigned int  id,
DWORD  c 
)

sets the color component if there is one (RBGA byte format)

Parameters:
[in] id is which channel to get set
[in] c is the color in RBGA byte format
DllExport DWORD* GetVCPtr ( unsigned int  id )

Returns the pointer to vertex color portion of the vertex.

DllExport unsigned int GetMaxUVW ( )

Returns the maximum number of supported UVW/texture channel.

DllExport float* GetUVW ( unsigned int  id )

Gets sets the UVW component if there is one returning *float to the start of the uwv coord.

Parameters:
[in] id is which channel to get set
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.

Parameters:
[in] id is which channel to get set
[in] uv the uv data to set
DllExport Point3 GetTangent ( )

gets the Tangent component if there is one

DllExport Point3* GetTangentPtr ( )

gets the pointer Tangent component if there is one

DllExport void SetTangent ( Point3  p )

sets the Tangent component if there is one

Parameters:
[in] p the tangent value
DllExport Point3 GetBinormal ( )

gets the BiNormal component if there is one

DllExport Point3* GetBinormalPtr ( )

gets the pointer BiNormal component if there is one

DllExport void SetBinormal ( Point3  p )

sets the BiNormal component if there is one

Parameters:
[in] p the BiNormal value
DllExport void CopyDataFrom ( HWVertex hwVertSource )

This lets you copy the vertex data from another vertex.

Parameters:
[in] hwVertSource this is the vertex that you want to copy from
DllExport BYTE* GetRawBufferPointer ( )

Returns a raw pointer the vertex buffer.


HWVertex HWVertex HWVertex HWVertex HWVertex HWVertex HWVertex HWVertex HWVertex HWVertex
HWVertex HWVertex HWVertex HWVertex HWVertex HWVertex HWVertex HWVertex HWVertex HWVertex