MaterialRequiredStreamElement Struct Reference
 
 
 
MaterialRequiredStreamElement Struct Reference

#include <MaterialRequiredStreams.h>

Inheritance diagram for MaterialRequiredStreamElement:
MaxHeapOperators

Class Description

This struct describes a single stream element that will be used by the hardware shader of a material.

More specifically, it defines one input parameter of vertex shader. Based on the structure we know exactly how to bind a max mesh channel to a vertex shader input parameter.

Classes

union   DataUnion

Public Member Functions

DataBridgeAPI  MaterialRequiredStreamElement ()
DataBridgeAPI  MaterialRequiredStreamElement (const MaterialRequiredStreamElement &from)
DataBridgeAPI
MaterialRequiredStreamElement
operator= (const MaterialRequiredStreamElement &from)
DataBridgeAPI  ~MaterialRequiredStreamElement ()
DataBridgeAPI int  Compare (const MaterialRequiredStreamElement &rhs) const
  Compare two MaterialRequiredStreamElement.
int  GetChannelID () const
  Get the max channel id which record where is the element come from.
DataBridgeAPI VertexFieldType  GetType () const
  Get the vertex field type of the stream element.
MeshChannelCategory  GetChannelCategory () const
  Get the channel category of the stream element.
unsigned short  GetUsageIndex () const
  Get the usage index of the stream element.
void  SetChannelID (int maxMapChannel)
  Set the max channel id which record where is the element come from.
DataBridgeAPI void  SetType (VertexFieldType type)
  Set the vertex element type.
void  SetChannelCategory (MeshChannelCategory channelCategory)
  Set the channel category of the element.
void  SetUsageIndex (unsigned short usageIndex)
  Set the usage index of the stream element.
DataBridgeAPI bool  GetIsInstanceStream () const
  Get whether this stream contains instance data.
DataBridgeAPI void  SetIsInstanceStream (bool value)
  Set whether this stream contains instance data.
DataBridgeAPI void  SetOffset (unsigned short offset)
DataBridgeAPI unsigned short  GetOffset () const
DataBridgeAPI void  SetStreamIndex (unsigned char index)
DataBridgeAPI unsigned char  GetStreamIndex () const
bool  operator== (const MaterialRequiredStreamElement &rhs) const
bool  operator!= (const MaterialRequiredStreamElement &rhs) const
bool  operator< (const MaterialRequiredStreamElement &rhs) const
bool  operator<= (const MaterialRequiredStreamElement &rhs) const
bool  operator> (const MaterialRequiredStreamElement &rhs) const
bool  operator>= (const MaterialRequiredStreamElement &rhs) const

Protected Attributes

DataUnion  mData

Constructor & Destructor Documentation

DataBridgeAPI ~MaterialRequiredStreamElement ( )

Member Function Documentation

DataBridgeAPI MaterialRequiredStreamElement& operator= ( const MaterialRequiredStreamElement from )
DataBridgeAPI int Compare ( const MaterialRequiredStreamElement rhs ) const

Compare two MaterialRequiredStreamElement.

Parameters:
rhs the "right-hand-side" MaterialRequiredStreamElement of the compare function.
Returns:
1 if this object is greater than rhs, -1 if this object is less than rhs, zero otherwise.
int GetChannelID ( ) const [inline]

Get the max channel id which record where is the element come from.

Remarks:
this function is used for channels related to texture coordinates like uv, tangent and bitangent. Since a mesh may have multiple texture coordinates, this id is used to differentiate those coordinates. For other vertex buffers like position and normal, the channel id is zero.
Returns:
the max channel id.
{
        return (int)((unsigned int)(mData.mChannelId));
}
DataBridgeAPI VertexFieldType GetType ( ) const

Get the vertex field type of the stream element.

Returns:
the vertex field type.
MeshChannelCategory GetChannelCategory ( ) const [inline]

Get the channel category of the stream element.

Returns:
the vertex channel category.
unsigned short GetUsageIndex ( ) const [inline]

Get the usage index of the stream element.

Returns:
the usage index.
{
        return mData.mUsageIndex;
}
void SetChannelID ( int  maxMapChannel ) [inline]

Set the max channel id which record where is the element come from.

Parameters:
maxMapChannel the channel id.
{
        mData.mChannelId = (char)maxMapChannel;
}
void SetType ( VertexFieldType  type ) [inline]

Set the vertex element type.

Parameters:
type the vertex element type.
{
        mData.mFieldType = (unsigned char)type;
}
void SetChannelCategory ( MeshChannelCategory  channelCategory ) [inline]

Set the channel category of the element.

Parameters:
channelCategory the channel category of the element.
{
        mData.mChannelCategory = (unsigned char)channelCategory;
}
void SetUsageIndex ( unsigned short  usageIndex ) [inline]

Set the usage index of the stream element.

Parameters:
usageIndex the usage index of the stream element.
{
        mData.mUsageIndex = (unsigned char)usageIndex;
}
DataBridgeAPI bool GetIsInstanceStream ( ) const

Get whether this stream contains instance data.

Returns:
true if it's a instance data stream
DataBridgeAPI void SetIsInstanceStream ( bool  value )

Set whether this stream contains instance data.

Only used when the stream is used as instance data Note: only last stream of a vertex buffer array can be used as instance stream

Parameters:
true to indicate this is a instance stream
DataBridgeAPI void SetOffset ( unsigned short  offset )
DataBridgeAPI unsigned short GetOffset ( ) const
DataBridgeAPI void SetStreamIndex ( unsigned char  index )
DataBridgeAPI unsigned char GetStreamIndex ( ) const
bool operator== ( const MaterialRequiredStreamElement rhs ) const [inline]
{
        return Compare(rhs) == 0;
}
bool operator!= ( const MaterialRequiredStreamElement rhs ) const [inline]
{
        return Compare(rhs) != 0;
}
bool operator< ( const MaterialRequiredStreamElement rhs ) const [inline]
{
        return Compare(rhs) < 0;
}
bool operator<= ( const MaterialRequiredStreamElement rhs ) const [inline]
{
        return Compare(rhs) <= 0;
}
bool operator> ( const MaterialRequiredStreamElement rhs ) const [inline]
{
        return Compare(rhs) > 0;
}
bool operator>= ( const MaterialRequiredStreamElement rhs ) const [inline]
{
        return Compare(rhs) >= 0;
}

Member Data Documentation