#include <VertexAttributeLayerAbstractData.h>
Inherits EMotionFX::VertexAttributeLayer.
The abstract data vertex attribute layer base class. This abstract data class can hold any type of attribute that has a fixed size per vertex.
◆ CalcTotalDataSizeInBytes()
uint32 EMotionFX::VertexAttributeLayerAbstractData::CalcTotalDataSizeInBytes |
( |
bool |
includeOriginals | ) |
const |
Calculate and return the total size of the layer data, in bytes. This multiplies the number of attributes with the size of one single attribute, in bytes. Optionally you can also choose to include the original data.
- Parameters
-
includeOriginals | Set to true if you want to include the original vertex data as well. |
- Returns
- Returns the size, in bytes, of the total attribute data that is being stored.
◆ Clone()
◆ Create()
static VertexAttributeLayerAbstractData * EMotionFX::VertexAttributeLayerAbstractData::Create |
( |
uint32 |
numAttributes, |
|
|
uint32 |
typeID, |
|
|
uint32 |
attribSizeInBytes, |
|
|
bool |
keepOriginals = false |
|
) |
| |
|
static |
The creation method.
- Parameters
-
numAttributes | The number of attributes to store inside this layer. |
typeID | The type ID of the data. This could be something that identifies position data, normals, or anything else. So not the data type itself, but what it will be used for. Some symantic value. |
attribSizeInBytes | The size, in bytes, of a single attribute. For example if the data stored internally will be a Vector3, this would be sizeof(Vector3), which would be 12 bytes. |
keepOriginals | Specifies whether a copy of the original data should be stored as well. The current data values wil then be restored to their original values every frame, before passing them through any mesh deformers. |
◆ GetAttributeSizeInBytes()
MCORE_INLINE uint32 EMotionFX::VertexAttributeLayerAbstractData::GetAttributeSizeInBytes |
( |
| ) |
const |
|
inline |
Get the size of one attribute in bytes. So if you create a layer that stores Vector3 objects, the size returned should be equal to sizeof(Vector3).
- Returns
- The size of a single attribute, in bytes.
◆ GetData() [1/2]
MCORE_INLINE void * EMotionFX::VertexAttributeLayerAbstractData::GetData |
( |
| ) |
|
|
inlineoverridevirtual |
Get a pointer to the data. You have to typecast the data yourself.
- Returns
- A pointer to the vertex data.
Reimplemented from EMotionFX::VertexAttributeLayer.
◆ GetData() [2/2]
MCORE_INLINE void * EMotionFX::VertexAttributeLayerAbstractData::GetData |
( |
uint32 |
attributeNr | ) |
|
|
inline |
Get a pointer to the data for a given attribute. You have to typecast the data yourself.
- Returns
- A pointer to the vertex data of the specified attribute number.
◆ GetIsAbstractDataClass()
bool EMotionFX::VertexAttributeLayerAbstractData::GetIsAbstractDataClass |
( |
| ) |
const |
|
overridevirtual |
◆ GetOriginalData() [1/2]
MCORE_INLINE void * EMotionFX::VertexAttributeLayerAbstractData::GetOriginalData |
( |
| ) |
|
|
inlineoverridevirtual |
Get a pointer to the original data, as it is stored in the base pose, before any mesh deformers have been applied. If there is no original data, it will just return a pointer to the regular data.
- Returns
- A pointer to the original vertex data, or the data as returned by GetData() if there isn't any original data.
Reimplemented from EMotionFX::VertexAttributeLayer.
◆ GetOriginalData() [2/2]
MCORE_INLINE void * EMotionFX::VertexAttributeLayerAbstractData::GetOriginalData |
( |
uint32 |
attributeNr | ) |
|
|
inline |
Get a pointer to the original data for a given attribute, as it is stored in the base pose, before any mesh deformers have been applied. If there is no original data, it will just return a pointer to the regular data for the given attribute.
- Returns
- A pointer to the original vertex data, or the data as returned by GetData(attributeNr) if there isn't any original data.
◆ GetType()
uint32 EMotionFX::VertexAttributeLayerAbstractData::GetType |
( |
| ) |
const |
|
overridevirtual |
Get the unique layer type. This identifies what type of attributes are stored internally. An example could be the type ID of an UV attribute layer, or a layer with colors or one which identifies a layer that contains softskinning information.
- Returns
- The unique type ID, which identifies what type of data is stored inside this layer. Each class inherited from the VertexAttributeLayer class requires a unique type ID.
Implements EMotionFX::VertexAttributeLayer.
◆ GetTypeString()
const char * EMotionFX::VertexAttributeLayerAbstractData::GetTypeString |
( |
| ) |
const |
|
overridevirtual |
Get the description of the vertex attributes or layer. You most likely want this to be the class name.
- Returns
- A pointer to the string containing the name or description of the type of vertex attributes of this layer.
Implements EMotionFX::VertexAttributeLayer.
◆ RemoveAttributes()
void EMotionFX::VertexAttributeLayerAbstractData::RemoveAttributes |
( |
uint32 |
startAttributeNr, |
|
|
uint32 |
endAttributeNr |
|
) |
| |
|
overridevirtual |
Remove a range of attributes.
- Parameters
-
startAttributeNr | The start attribute number. |
endAttributeNr | The end attribute number, which will also be removed. |
Implements EMotionFX::VertexAttributeLayer.
◆ RemoveSwapBuffer()
void EMotionFX::VertexAttributeLayerAbstractData::RemoveSwapBuffer |
( |
| ) |
|
Remove a temp swap buffer from memory. This temp swap buffer is a pre-allocated buffer, which will prevent having to do an allocation every time you call the SwapAttributes method, which is for example used by the LOD generator of EMotion FX.
◆ ResetToOriginalData()
void EMotionFX::VertexAttributeLayerAbstractData::ResetToOriginalData |
( |
| ) |
|
|
overridevirtual |
Reset the layer data to it's original data. This is used to restore for example skinned data back into the data as it is in the base pose. The mesh deformers will use this as a starting point then.
Implements EMotionFX::VertexAttributeLayer.
◆ SwapAttributes()
void EMotionFX::VertexAttributeLayerAbstractData::SwapAttributes |
( |
uint32 |
attribA, |
|
|
uint32 |
attribB |
|
) |
| |
|
overridevirtual |
Swap the data for two attributes. You specify two attribute numbers, the data for them should be swapped. This is used by the geometry LOD system and will be called by Mesh::SwapVertex as well.
- Parameters
-
attribA | The first attribute number. |
attribB | The second attribute number. |
Implements EMotionFX::VertexAttributeLayer.
The documentation for this class was generated from the following file:
- Gems/EMotionFX/Code/EMotionFX/Source/VertexAttributeLayerAbstractData.h