Classes

Animation/Components

Brief descriptions

Structures

nau::animation::AnimTrackCreationInfo

nau::ISkeletonAnimatableKeyFrameType

nau::SkeletalTrackData

nau::SkeletalAnimRuntimeData

Classes

nau::animation::AnimationComponent

Provides opportunity to animate properties of a target.

nau::SkeletonComponent

nau::SkeletonSocketComponent

Provides opportunity for child objects to be attached to (i.e. move together with) a particular bone of the skeleton.

Detailed information

animation::AnimTrackCreationInfo

engine/core/modules/animation/include/nau/animation/components/animation_component.h

struct AnimTrackCreationInfo

Public Members

animationName
playMode
initialWeight
channelTargetPath
blendMethod
animationAsset eastl::string animationName
eastl::string playMode
float initialWeight
eastl::string channelTargetPath
eastl::string blendMethod
AnimationAssetRef animationAsset
nau::WeakPtr<AnimationInstance> owningInstance

ISkeletonAnimatableKeyFrameType

engine/core/modules/animation/include/nau/animation/components/skeleton_component.h

struct ISkeletonAnimatableKeyFrameType

SkeletalTrackData

engine/core/modules/animation/include/nau/animation/components/skeleton_component.h

struct SkeletalTrackData

Public Members

float weight
animation::AnimationBlendMethod blendMethod
ozz::animation::SamplingJob::Context animSamplingContext
ozz::vector<ozz::math::SoaTransform> locals

SkeletalAnimRuntimeData

engine/core/modules/animation/include/nau/animation/components/skeleton_component.h

struct SkeletalAnimRuntimeData

Public Members

eastl::map<nau::string, SkeletalTrackData> tracks
ozz::vector<ozz::math::SoaTransform> locals

animation::AnimationComponent

engine/core/modules/animation/include/nau/animation/components/animation_component.h

class AnimationComponent : public nau::scene::SceneComponent, public nau::scene::IComponentUpdate, public nau::scene::IComponentEvents, public nau::animation::ITransformAnimatable, public nau::scene::IComponentActivation

Provides opportunity to animate properties of a target.

Private Functions

NAU_OBJECT(nau::animation::AnimationComponent, scene::SceneComponent, scene::IComponentUpdate, scene::IComponentEvents, ITransformAnimatable, scene::IComponentActivation) 1 1(1(scene ~AnimationComponent ()

Default constructor.

Destructor.

virtual void onAfterComponentRestored() override

Method that is called upon component restoration when the scene is being deserialized from an asset.

virtual void updateComponent(float dt) override

Updates the animation in tick.

Parameters:

dt[in] Time in seconds elapsed since the last update.

void addAnimation(nau::Ptr<AnimationInstance> animation)

Binds the animation to the controller.

Parameters:

animation[in] A pointer to the animation instance to bind.

void addAnimationTarget(IAnimationTarget::Ptr target)

Adds the object to the collection of the objects animated by the component.

Parameters:

target[in] A pointer to the object to add.

void addCustomAnimationTarget(IAnimationTarget::Ptr target, IAnimationPlayer::Ptr player)

Adds the object to the collection of the objects animated by the component.

Parameters:
  • target[in] A pointer to the object to add.

  • player[in] A pointer to the custom player object to use for the animation playback.

void setController(nau::Ptr<AnimationController> controller)

Assigns the controller to manage the animation instances attached to the component.

Parameters:

controller[in] A pointer to the controller object to assign.

AnimationController *getController() const

Retrieves the controller managing the animation instances attached to the component.

Returns:

A pointer to the assigned controller or NULL if the controller is not attached.

template<class TController>
inline TController *getController() const

Retrieves the controller managing the animation instances attached to the component.

Template Parameters:

TController – Type of the controller to retrieve.

Returns:

A pointer to the assigned controller or NULL if the controller is not attached or if the TController mismatches the actual type of the asssigned controller.

const eastl::string &getName() const

Retrieves the component name.

AnimationController *getOrCreateController()
virtual void animateTransform(const nau::math::Transform &transform) override
virtual void animateTranslation(const math::vec3 &translation) override
virtual void animateRotation(const math::quat &rotation) override
virtual void animateScale(const math::vec3 &scale) override
virtual void *getTarget(const rtti::TypeInfo &requestedTarget, IAnimationPlayer *player) override
virtual scene::SceneObject *getOwner() override
void applyTransform()
void updateTrackSerializationInfo(nau::Ptr<AnimationInstance> animInstancePtr)
virtual async::Task activateComponentAsync() override
virtual void deactivateComponent() override

Deactivates the component.

Private Members

eastl::string m_animControllerType
eastl::vector<AnimTrackCreationInfo> m_tracksCreationInfo
nau::Ptr<AnimationController> m_controller
nau::math::Transform m_rootTransform
math::Transform m_frameTransform
std::vector<AnimationTargetData> m_targets
eastl::string m_name
TransformAnimationActionsFlag m_pendingTransforms = {}
struct AnimationTargetData

Public Functions

inline AnimationTargetData(IAnimationTarget::Ptr &&inTarget, IAnimationPlayer::Ptr &&inPlayer)

Public Members

IAnimationTarget::Ptr target
IAnimationPlayer::Ptr player

SkeletonComponent

engine/core/modules/animation/include/nau/animation/components/skeleton_component.h

class SkeletonComponent : public nau::scene::SceneComponent, public nau::animation::IAnimatable

Public Functions

SkeletonComponent()
const eastl::string &getName() const
SkeletonAssetRef &getSkeletonAsset() const
nau::Ptr<SkeletonAssetView> getSkeletonAssetView() const noexcept
void setSkeletonAsset(SkeletonAssetRef assetRef)
void setSkeletonAssetView(nau::Ptr<SkeletonAssetView> assetView)
void setSkeletonToDefaultPose()
const ozz::animation::Skeleton &getSkeleton() const
const eastl::vector<SkeletonJoint> &getJoints() const
const eastl::vector<nau::math::Matrix4> &getInverseBindTransforms() const
unsigned getBonesCount() const
const ozz::vector<ozz::math::Float4x4> &getModelSpaceJointMatrices() const
ozz::vector<ozz::math::Float4x4> &getModelSpaceJointMatricesMutable()
SkeletalAnimRuntimeData &getAnimRuntimeDataMutable()

Public Static Attributes

static bool drawDebugSkeletons

Private Functions

Skeleton (description)")) ( 1(m_skeletonAsset

Private Members

true
Skeleton
skeletonAsset
mutable SkeletonAssetRef m_skeletonAsset
nau::Ptr<SkeletonAssetView> m_skeletonAssetView
SkeletalAnimRuntimeData animRuntimeData
ozz::vector<ozz::math::Float4x4> models
eastl::string m_name

SkeletonSocketComponent

engine/core/modules/animation/include/nau/animation/components/skeleton_socket_component.h

class SkeletonSocketComponent : public nau::scene::SceneComponent, public nau::scene::IComponentUpdate

Provides opportunity for child objects to be attached to (i.e. move together with) a particular bone of the skeleton.

Private Functions

NAU_OBJECT(nau::SkeletonSocketComponent, scene::SceneComponent, scene::IComponentUpdate) 1(1(scene void setBoneName (const eastl::string &boneName)

Attaches the socket to a particular bone.

Parameters:

boneName[in] Name of the bone to attach the socket to.

const eastl::string &getBoneName() const

Retrieves the name of the bone the socket is attached to.

Returns:

Name of the bone the socket is attached to.

void setRelativeToBoneOffset(const math::Transform &transform)

Applies the socket transform relative to the bone it is attached to.

Parameters:

transform[in] Relative transfrom to apply.

const math::Transform &getRelativeToBoneOffset() const

Retrieves the transform of the socket relative to the bone it is attached to.

Returns:

Socket relative transform.

Private Members

eastl::string m_boneName
math::Transform m_relativeToBoneOffset