RavEngine
Loading...
Searching...
No Matches
RavEngine::AnimatorComponent Class Reference
Inheritance diagram for RavEngine::AnimatorComponent:
[legend]
Collaboration diagram for RavEngine::AnimatorComponent:
[legend]

Classes

struct  Layer
 
struct  State
 

Public Member Functions

 MOVE_NO_COPY (AnimatorComponent)
 
 AnimatorComponent (Ref< SkeletonAsset > sk)
 
void Tick (const Transform &t)
 
decltype(skeleton) GetSkeleton () const
 
virtual void DebugDraw (RavEngine::DebugDrawer &dbg, const Transform &) const override
 
void UpdateSocket (const std::string &, Transform &) const
 
Layer * AddLayer ()
 
Layer * GetLayerAtIndex (uint16_t index)
 
const decltype(glm_pose) & GetPose (const Transform &t) const
 
const decltype(local_pose) & GetLocalPose ()
 
const decltype(skinningmats) & GetSkinningMats ()
 

Static Public Attributes

static constexpr uint16_t kmax_layers = 32
 
- Static Public Attributes inherited from RavEngine::Queryable< AnimatorComponent, IDebugRenderable >
static constexpr std::size_t ntypes
 

Protected Member Functions

void UpdateSkeletonData (Ref< SkeletonAsset > sk)
 

Protected Attributes

ozz::vector< matrix4 > glm_pose
 
ozz::vector< matrix4 > local_pose
 
ozz::vector< matrix4 > skinningmats
 
ozz::vector< ozz::math::Float4x4 > models
 
ozz::vector< ozz::math::SoaTransform > all_transforms
 
Vector< std::unique_ptr< Layer > > layers
 

Additional Inherited Members

- Public Types inherited from RavEngine::Queryable< AnimatorComponent, IDebugRenderable >
typedef std::array< ctti_t, ntypes > arraytype
 
- Static Public Member Functions inherited from RavEngine::Queryable< AnimatorComponent, IDebugRenderable >
static constexpr const arraytype & GetQueryTypes ()
 
- Public Attributes inherited from RavEngine::IDebugRenderable
bool debugEnabled = false
 
color_t debug_color = 0xFFFFFFFF
 
- Public Attributes inherited from RavEngine::Queryable< AnimatorComponent, IDebugRenderable >
constexpr q_qt_def
 

Constructor & Destructor Documentation

◆ AnimatorComponent()

RavEngine::AnimatorComponent::AnimatorComponent ( Ref< SkeletonAsset >  sk)

Create an AnimatorComponent with a SkeletonAsset

Parameters
skthe skeleton asset

Transitions to the new state. If the current state has a transition to the target state, that transition is played. Otherwise, the state machine simply jumps to the target state without a transition.

Parameters
newStatethe state to switch to Create an AnimatorComponent with a SkeletonAsset
skthe skeleton asset

Member Function Documentation

◆ AddLayer()

RavEngine::AnimatorComponent::Layer * RavEngine::AnimatorComponent::AddLayer ( )

Add a layer to the end

Returns
the created layer

◆ DebugDraw()

void AnimatorComponent::DebugDraw ( RavEngine::DebugDrawer &  dbg,
const Transform &  transform 
) const
overridevirtual

Draw a wireframe shape representing the boundary of this object

Parameters
colorthe hex color to use to draw, in format 0xRRGGBBAA

Implements RavEngine::IDebugRenderable.

◆ GetPose()

decltype(RavEngine::AnimatorComponent::glm_pose) const & RavEngine::AnimatorComponent::GetPose ( const Transform &  t) const

Get the current pose of the animation in world space

Returns
vector of matrices representing the world-space transformations of every joint in the skeleton for the current animation frame

◆ Tick()

void AnimatorComponent::Tick ( const Transform &  t)

Process one frame of this animator.

Parameters
tthe transform component on the object

◆ UpdateSkeletonData()

void RavEngine::AnimatorComponent::UpdateSkeletonData ( Ref< SkeletonAsset >  sk)
inlineprotected

Update buffer sizes for current skeleton


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