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::VertexAttributeLayer Class Referenceabstract

#include <VertexAttributeLayer.h>

Inherits EMotionFX::BaseObject.

Inherited by EMotionFX::SkinningInfoVertexAttributeLayer, and EMotionFX::VertexAttributeLayerAbstractData.

Public Member Functions

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
 

Protected Member Functions

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

Protected Attributes

uint32 m_numAttributes
 
uint32 m_nameId
 
bool m_keepOriginals
 

Detailed Description

The vertex attribute layer base class. Each mesh can have a set of custom vertex attribute layers. Each layer must be inherited from this base class and must store its custom data, such as texture coordinates or vertex color or softskinning information.

Constructor & Destructor Documentation

◆ VertexAttributeLayer()

EMotionFX::VertexAttributeLayer::VertexAttributeLayer ( uint32  numAttributes,
bool  keepOriginals = false 
)
protected

The constructor.

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

◆ ~VertexAttributeLayer()

virtual EMotionFX::VertexAttributeLayer::~VertexAttributeLayer ( )
protectedvirtual

The destructor, which should delete all allocated attributes from memory.

Member Function Documentation

◆ Clone()

virtual VertexAttributeLayer * EMotionFX::VertexAttributeLayer::Clone ( )
pure virtual

Clone the vertex attribute layer.

Returns
A clone of this layer.

Implemented in EMotionFX::SkinningInfoVertexAttributeLayer, and EMotionFX::VertexAttributeLayerAbstractData.

◆ GetData()

virtual void * EMotionFX::VertexAttributeLayer::GetData ( )
inlinevirtual

Get a pointer to the data. You have to typecast the data yourself.

Returns
A pointer to the vertex data.

Reimplemented in EMotionFX::VertexAttributeLayerAbstractData.

◆ GetIsAbstractDataClass()

virtual bool EMotionFX::VertexAttributeLayer::GetIsAbstractDataClass ( ) const
virtual

Returns true when this is the VertexAttributeLayerAbstractData class. On default this returns false and you don't have to overload this. It is just an internal thing that was needed to make the whole abstract data idea work.

Returns
Returns true when this is the VertexAttributeLayerAbstractData class. Otherwise false is returned.

Reimplemented in EMotionFX::VertexAttributeLayerAbstractData.

◆ GetKeepOriginals()

MCORE_INLINE bool EMotionFX::VertexAttributeLayer::GetKeepOriginals ( ) const
inline

Check if this class also stores original vertex data or not. This will store twice as many attributes in memory and is used for vertex data that can be deformed, such as positions, normals and tangents. Before applying deformations to the data returned by GetData() the current vertex data returned by this method will be initialized to its original data as it was before any deformations. The initialization to the original data happens inside the ResetToOriginalData method.

Returns
Returns true when this class also stores the original (undeformed) data, next to the current (deformed) data.

◆ GetNumAttributes()

MCORE_INLINE uint32 EMotionFX::VertexAttributeLayer::GetNumAttributes ( ) const
inline

Get the number of attributes inside this layer.

Returns
The number of attributes.

◆ GetOriginalData()

virtual void * EMotionFX::VertexAttributeLayer::GetOriginalData ( )
inlinevirtual

Get a pointer to the original data, as it is stored in the base pose, before any mesh deformers have been applied.

Returns
A pointer to the original vertex data.

Reimplemented in EMotionFX::VertexAttributeLayerAbstractData.

◆ GetType()

virtual uint32 EMotionFX::VertexAttributeLayer::GetType ( ) const
pure virtual

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.

Implemented in EMotionFX::SkinningInfoVertexAttributeLayer, and EMotionFX::VertexAttributeLayerAbstractData.

◆ GetTypeString()

virtual const char * EMotionFX::VertexAttributeLayer::GetTypeString ( ) const
pure virtual

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.

Implemented in EMotionFX::SkinningInfoVertexAttributeLayer, and EMotionFX::VertexAttributeLayerAbstractData.

◆ RemoveAttributes()

virtual void EMotionFX::VertexAttributeLayer::RemoveAttributes ( uint32  startAttributeNr,
uint32  endAttributeNr 
)
pure virtual

Remove a range of attributes.

Parameters
startAttributeNrThe start attribute number.
endAttributeNrThe end attribute number, which will also be removed.

Implemented in EMotionFX::SkinningInfoVertexAttributeLayer, and EMotionFX::VertexAttributeLayerAbstractData.

◆ ResetToOriginalData()

virtual void EMotionFX::VertexAttributeLayer::ResetToOriginalData ( )
pure virtual

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.

Implemented in EMotionFX::SkinningInfoVertexAttributeLayer, and EMotionFX::VertexAttributeLayerAbstractData.

◆ Scale()

virtual void EMotionFX::VertexAttributeLayer::Scale ( float  scaleFactor)
inlinevirtual

Scale all vertex data (should scale positional data and maybe more). This is a slow operation and is used to convert between different unit systems (cm, meters, etc).

Parameters
scaleFactorThe scale factor to scale the current data by.

◆ SwapAttributes()

virtual void EMotionFX::VertexAttributeLayer::SwapAttributes ( uint32  attribA,
uint32  attribB 
)
pure virtual

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.

Implemented in EMotionFX::SkinningInfoVertexAttributeLayer, and EMotionFX::VertexAttributeLayerAbstractData.

Member Data Documentation

◆ m_keepOriginals

bool EMotionFX::VertexAttributeLayer::m_keepOriginals
protected

Should we store a copy of the original data as well?

◆ m_nameId

uint32 EMotionFX::VertexAttributeLayer::m_nameId
protected

The name ID.

◆ m_numAttributes

uint32 EMotionFX::VertexAttributeLayer::m_numAttributes
protected

The number of attributes inside this layer.


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