MaterialRequiredStreamElement Struct Reference


Detailed 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.

#include <MaterialRequiredStreams.h>

Inheritance diagram for MaterialRequiredStreamElement:
Inheritance graph
[legend]

List of all members.

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.
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.
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.
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));
}
VertexFieldType GetType ( ) const [inline]

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 = (unsigned long)((unsigned int)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 = usageIndex;
}
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