![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The IAttributeContainer property interface.
This interface provides a common way to store and retrieve individual vertex attributes of different types, usually found in nodes implementing e.g. the Graph::IVertexBuffer interface.
Add a predefined vertex attribute. This method adds a predefined vertex attribute to the container, with a given attribute type and a given byte offset relative to each vertex entry's start pointer. As a convenience, the byte offset variable is incremented by the actual number of bytes used by the given attribute type, e.g. 12 for a 3-component vector of floats. If successful, this method returns the zero-based index of the newly created attribute in the container; if failed, -1 is returned.
Integer, Integer AddAttribute(Murl.IEnums.AttributeItem item, Murl.IEnums.AttributeType type, Integer byteOffset)
item | The predefined attribute to add. |
type | The attribute's data type. |
byteOffset | The byte offset of the attribute location relative to a vertex entry's start. |
Add a user-defined vertex attribute. This method adds a user-defined vertex attribute to the container, with a given attribute type and a given byte offset relative to each vertex entry's start pointer. The newly created attribute is only in effect when a shader material is currently active that actually uses an attribute with the given name as input to the vertex shader. As a convenience, the byte offset variable is incremented by the actual number of bytes used by the given attribute type, e.g. 12 for a 3-component vector of floats. If successful, this method returns the zero-based index of the newly created attribute in the container; if failed, -1 is returned.
Integer, Integer AddAttribute(String name, Murl.IEnums.AttributeType type, Integer byteOffset)
name | The name of the attribute variable to add. |
type | The attribute's data type. |
byteOffset | The byte offset of the attribute location relative to a vertex entry's start. |
Query the location of a predefined attribute in the container. This method can be used to query the zero-based index of a given predefined attribute in the container. If the container does not hold the given attribute, -1 is returned.
Integer GetAttributeIndex(Murl.IEnums.AttributeItem item)
item | The predefined attribute to query. |
Query the location of a user-defined attribute in the container. This method can be used to query the zero-based index of a given user-defined attribute in the container. If the container does not hold the given attribute, -1 is returned.
Integer GetAttributeIndex(String name)
name | The name of the user-defined attribute to query. |
Get the total number of individual attributes in the container.
Integer GetNumberOfAttributes()
Query the type of an attribute at a given index.
Murl.IEnums.AttributeType GetAttributeType(Integer index)
index | The zero-based index of the attribute to query. |
Query the predefined item of an attribute at a given index. If the attribute at the given index represents a predefined one, this method returns the actual item, e.g. IEnums::ATTRIBUTE_ITEM_NORMAL for vertex normal vectors. If the attribute is a user-defined one, it returns IEnums::ATTRIBUTE_ITEM_CUSTOM.
Murl.IEnums.AttributeItem GetAttributeItem(Integer index)
index | The zero-based index of the attribute to query. |
Query the variable name of an attribute at a given index. If the attribute at the given index represents a user-defined one, this method returns its actual name string. If it is a predefined one, an empty string is returned.
String GetAttributeName(Integer index)
index | The zero-based index of the attribute to query. |
Get the byte offset of an attribute at a given index.
Integer GetAttributeByteOffset(Integer index)
index | The zero-based index of the attribute to query. |
Get the attribute object at a given index. This method returns an actual attribute object by its Graph::IAttribute base interface. The base interface can be used to query common attribute properties; if access to actual attribute data is required, use either a dynamic_cast to one of the available specialized interfaces (e.g. Graph::IFloatVector4Attribute), or use the respective explicit method, e.g. GetFloatVector4Attribute().
Murl.Graph.IAttribute GetAttribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a scalar float object. This method can be used as a convenience to retrieve a typed attribute object. If the attribute present in the container at the given index does not match the requested type (scalar float in this case), a null pointer is returned.
Murl.Graph.IFloatAttribute GetFloatAttribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 2-component float vector object. See GetFloatAttribute().
Murl.Graph.IFloatVector2Attribute GetFloatVector2Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 3-component float vector object. See GetFloatAttribute().
Murl.Graph.IFloatVector3Attribute GetFloatVector3Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 4-component float vector object. See GetFloatAttribute().
Murl.Graph.IFloatVector4Attribute GetFloatVector4Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a scalar UInt8 object. See GetFloatAttribute().
Murl.Graph.IUInt8Attribute GetUInt8Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 2-component UInt8 vector object. See GetFloatAttribute().
Murl.Graph.IUInt8Vector2Attribute GetUInt8Vector2Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 3-component UInt8 vector object. See GetFloatAttribute().
Murl.Graph.IUInt8Vector3Attribute GetUInt8Vector3Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 4-component UInt8 vector object. See GetFloatAttribute().
Murl.Graph.IUInt8Vector4Attribute GetUInt8Vector4Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a scalar SInt8 object. See GetFloatAttribute().
Murl.Graph.ISInt8Attribute GetSInt8Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 2-component SInt8 vector object. See GetFloatAttribute().
Murl.Graph.ISInt8Vector2Attribute GetSInt8Vector2Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 3-component SInt8 vector object. See GetFloatAttribute().
Murl.Graph.ISInt8Vector3Attribute GetSInt8Vector3Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 4-component SInt8 vector object. See GetFloatAttribute().
Murl.Graph.ISInt8Vector4Attribute GetSInt8Vector4Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a scalar UInt16 object. See GetFloatAttribute().
Murl.Graph.IUInt16Attribute GetUInt16Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 2-component UInt16 vector object. See GetFloatAttribute().
Murl.Graph.IUInt16Vector2Attribute GetUInt16Vector2Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 3-component UInt16 vector object. See GetFloatAttribute().
Murl.Graph.IUInt16Vector3Attribute GetUInt16Vector3Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 4-component UInt16 vector object. See GetFloatAttribute().
Murl.Graph.IUInt16Vector4Attribute GetUInt16Vector4Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a scalar SInt16 object. See GetFloatAttribute().
Murl.Graph.ISInt16Attribute GetSInt16Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 2-component SInt16 vector object. See GetFloatAttribute().
Murl.Graph.ISInt16Vector2Attribute GetSInt16Vector2Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 3-component SInt16 vector object. See GetFloatAttribute().
Murl.Graph.ISInt16Vector3Attribute GetSInt16Vector3Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 4-component SInt16 vector object. See GetFloatAttribute().
Murl.Graph.ISInt16Vector4Attribute GetSInt16Vector4Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a scalar UInt32 object. See GetFloatAttribute().
Murl.Graph.IUInt32Attribute GetUInt32Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 2-component UInt32 vector object. See GetFloatAttribute().
Murl.Graph.IUInt32Vector2Attribute GetUInt32Vector2Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 3-component UInt32 vector object. See GetFloatAttribute().
Murl.Graph.IUInt32Vector3Attribute GetUInt32Vector3Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 4-component UInt32 vector object. See GetFloatAttribute().
Murl.Graph.IUInt32Vector4Attribute GetUInt32Vector4Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a scalar SInt32 object. See GetFloatAttribute().
Murl.Graph.ISInt32Attribute GetSInt32Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 2-component SInt32 vector object. See GetFloatAttribute().
Murl.Graph.ISInt32Vector2Attribute GetSInt32Vector2Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 3-component SInt32 vector object. See GetFloatAttribute().
Murl.Graph.ISInt32Vector3Attribute GetSInt32Vector3Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a 4-component SInt32 vector object. See GetFloatAttribute().
Murl.Graph.ISInt32Vector4Attribute GetSInt32Vector4Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized scalar UInt8 object. See GetFloatAttribute().
Murl.Graph.IUInt8Attribute GetNormalizedUInt8Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized 2-component UInt8 vector object. See GetFloatAttribute().
Murl.Graph.IUInt8Vector2Attribute GetNormalizedUInt8Vector2Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized 3-component UInt8 vector object. See GetFloatAttribute().
Murl.Graph.IUInt8Vector3Attribute GetNormalizedUInt8Vector3Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized 4-component UInt8 vector object. See GetFloatAttribute().
Murl.Graph.IUInt8Vector4Attribute GetNormalizedUInt8Vector4Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized scalar SInt8 object. See GetFloatAttribute().
Murl.Graph.ISInt8Attribute GetNormalizedSInt8Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized 2-component SInt8 vector object. See GetFloatAttribute().
Murl.Graph.ISInt8Vector2Attribute GetNormalizedSInt8Vector2Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized 3-component SInt8 vector object. See GetFloatAttribute().
Murl.Graph.ISInt8Vector3Attribute GetNormalizedSInt8Vector3Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized 4-component SInt8 vector object. See GetFloatAttribute().
Murl.Graph.ISInt8Vector4Attribute GetNormalizedSInt8Vector4Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized scalar UInt16 object. See GetFloatAttribute().
Murl.Graph.IUInt16Attribute GetNormalizedUInt16Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized 2-component UInt16 vector object. See GetFloatAttribute().
Murl.Graph.IUInt16Vector2Attribute GetNormalizedUInt16Vector2Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized 3-component UInt16 vector object. See GetFloatAttribute().
Murl.Graph.IUInt16Vector3Attribute GetNormalizedUInt16Vector3Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized 4-component UInt16 vector object. See GetFloatAttribute().
Murl.Graph.IUInt16Vector4Attribute GetNormalizedUInt16Vector4Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized scalar SInt16 object. See GetFloatAttribute().
Murl.Graph.ISInt16Attribute GetNormalizedSInt16Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized 2-component SInt16 vector object. See GetFloatAttribute().
Murl.Graph.ISInt16Vector2Attribute GetNormalizedSInt16Vector2Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized 3-component SInt16 vector object. See GetFloatAttribute().
Murl.Graph.ISInt16Vector3Attribute GetNormalizedSInt16Vector3Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |
Get the attribute at a given index as a normalized 4-component SInt16 vector object. See GetFloatAttribute().
Murl.Graph.ISInt16Vector4Attribute GetNormalizedSInt16Vector4Attribute(Integer index)
index | The zero-based index of the attribute to retrieve. |