Open 3D Engine EMotionFX Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
EMotionFX::VertexAttributeLayerAbstractData Class Reference

#include <VertexAttributeLayerAbstractData.h>

Inherits EMotionFX::VertexAttributeLayer.

Public Member Functions

uint32 GetType () const override
 
const char * GetTypeString () const override
 
VertexAttributeLayerClone () override
 
void ResetToOriginalData () override
 
void SwapAttributes (uint32 attribA, uint32 attribB) override
 
void RemoveAttributes (uint32 startAttributeNr, uint32 endAttributeNr) override
 
MCORE_INLINE void * GetData (uint32 attributeNr)
 
MCORE_INLINE void * GetData () override
 
MCORE_INLINE uint32 GetAttributeSizeInBytes () const
 
MCORE_INLINE void * GetOriginalData () override
 
MCORE_INLINE void * GetOriginalData (uint32 attributeNr)
 
uint32 CalcTotalDataSizeInBytes (bool includeOriginals) const
 
void RemoveSwapBuffer ()
 
bool GetIsAbstractDataClass () const override
 
- Public Member Functions inherited from EMotionFX::VertexAttributeLayer
virtual uint32 GetType () const =0
 
virtual const char * GetTypeString () const =0
 
virtual VertexAttributeLayerClone ()=0
 
virtual void * GetData ()
 
virtual void * GetOriginalData ()
 
MCORE_INLINE uint32 GetNumAttributes () const
 
MCORE_INLINE bool GetKeepOriginals () const
 
virtual void ResetToOriginalData ()=0
 
virtual void SwapAttributes (uint32 attribA, uint32 attribB)=0
 
virtual void RemoveAttributes (uint32 startAttributeNr, uint32 endAttributeNr)=0
 
virtual bool GetIsAbstractDataClass () const
 
virtual void Scale (float scaleFactor)
 
void SetName (const char *name)
 
const char * GetName () const
 
const AZStd::string & GetNameString () const
 
uint32 GetNameID () const
 
- Public Member Functions inherited from EMotionFX::BaseObject
 BaseObject ()
 
virtual ~BaseObject ()
 
- Public Member Functions inherited from MCore::MemoryObject
 MemoryObject ()
 
virtual ~MemoryObject ()
 
void IncreaseReferenceCount ()
 
void DecreaseReferenceCount ()
 
void Destroy ()
 
uint32 GetReferenceCount () const
 

Static Public Member Functions

static VertexAttributeLayerAbstractDataCreate (uint32 numAttributes, uint32 typeID, uint32 attribSizeInBytes, bool keepOriginals=false)
 

Additional Inherited Members

- Protected Member Functions inherited from EMotionFX::VertexAttributeLayer
 VertexAttributeLayer (uint32 numAttributes, bool keepOriginals=false)
 
virtual ~VertexAttributeLayer ()
 
- Protected Member Functions inherited from EMotionFX::BaseObject
void Delete () override
 
virtual void Delete ()
 
- Protected Attributes inherited from EMotionFX::VertexAttributeLayer
uint32 m_numAttributes
 
uint32 m_nameId
 
bool m_keepOriginals
 

Detailed Description

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.

Member Function Documentation

◆ 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
includeOriginalsSet 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()

VertexAttributeLayer * EMotionFX::VertexAttributeLayerAbstractData::Clone ( )
overridevirtual

Clone the vertex attribute layer.

Returns
A clone of this layer.

Implements EMotionFX::VertexAttributeLayer.

◆ Create()

static VertexAttributeLayerAbstractData * EMotionFX::VertexAttributeLayerAbstractData::Create ( uint32  numAttributes,
uint32  typeID,
uint32  attribSizeInBytes,
bool  keepOriginals = false 
)
static

The creation method.

Parameters
numAttributesThe number of attributes to store inside this layer.
typeIDThe 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.
attribSizeInBytesThe 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.
keepOriginalsSpecifies 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

Returns true when this is the VertexAttributeLayerAbstractData class. It is just an internal thing that was needed to make the whole abstract data idea work.

Returns
Returns always true for this class.

Reimplemented from EMotionFX::VertexAttributeLayer.

◆ 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
startAttributeNrThe start attribute number.
endAttributeNrThe 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
attribAThe first attribute number.
attribBThe second attribute number.

Implements EMotionFX::VertexAttributeLayer.


The documentation for this class was generated from the following file: