载入中...
搜索中...
未找到
eve::animation::AnimPlayer类 参考

Single-clip (or cross-fading) 3D animation player. Script type: AnimPlayer. 更多...

#include <AnimPlayer.h>

类 eve::animation::AnimPlayer 继承关系图:
eve::animation::IAnimPoseSource

Public 成员函数

 AnimPlayer (AnimSkeleton *skeleton)
 Anim player.
 
 ~AnimPlayer () override=default
 Anim player.
 
 AnimPlayer (const AnimPlayer &)=delete
 
AnimPlayer & operator= (const AnimPlayer &)=delete
 
AnimSkeleton * getSkeleton () const override
 Borrowed pointer accessor. @ownership Borrowed @lifetime Valid while the owning animation object remains alive; do not retain across destruction.
 
void play (AnimClip *clip)
 Play.
 
void crossFade (AnimClip *clip, float blendSeconds)
 Cross-fade to clip over blendSeconds (keeps sampling previous until done).
 
void setBlendCurve (AnimBlendCurve curve) noexcept
 Select the curve used by subsequent and active cross-fades.
 
void stop ()
 Stops .
 
void pause ()
 Pause.
 
void resume ()
 Resume.
 
void setSpeed (float speed)
 Sets the speed.
 
float getSpeed () const
 Returns the speed.
 
void setTime (float seconds)
 Sets the time.
 
float getTime () const
 Returns the time.
 
void setLoop (bool loop)
 Sets the loop.
 
bool getLoop () const
 Returns the loop.
 
bool isPlaying () const
 True when playing.
 
bool isPaused () const
 True when paused.
 
AnimClip * getClip () const
 Borrow the selected clip, or null if none is selected. The caller owns the clip and must keep it alive during playback and this borrow. Playback changes can replace the selected clip; no ownership is transferred. @thread Owner thread only, outside advance; no callbacks or reentrancy.
 
AnimPose * getPose () override
 Borrowed pointer accessor. @ownership Borrowed @lifetime Valid while the owning animation object remains alive; do not retain across destruction.
 
void setRootMotionBone (int boneIndex)
 Select the bone whose per-frame motion is extracted (default 0).
 
int getRootMotionBone () const
 Returns the root motion bone.
 
eve::Result< void > setRootMotionPolicy (const RootMotionPolicy &policy)
 Replace the root-motion filter/bake/apply policy used by subsequent updates.
 
RootMotionPolicy getRootMotionPolicy () const
 Copy of the active root-motion policy.
 
eve::Result< void > setRootMotionCharacterYaw (float yawRadians)
 Set CharacterFacing yaw in radians without replacing the rest of the policy.
 
float getRootMotionX () const
 Controller-facing translation X after policy filtering (BoneLocal or CharacterFacing).
 
float getRootMotionY () const
 Returns the root motion y.
 
float getRootMotionZ () const
 Returns the root motion z.
 
float getRootMotionRotationX () const
 Returns the root motion rotation x.
 
float getRootMotionRotationY () const
 Returns the root motion rotation y.
 
float getRootMotionRotationZ () const
 Returns the root motion rotation z.
 
float getRootMotionRotationW () const
 Returns the root motion rotation w.
 
std::string consumeEvent ()
 Pop the oldest notify crossed since the previous update.
 
void setUpdateRate (float hz)
 Limit pose evaluation frequency for animation LOD; 0 updates every call.
 
float getUpdateRate () const
 Returns the update rate.
 
int getEventCount () const override
 Number of events crossed by the most recent play/update call.
 
std::string getEventName (int index) const override
 Name of a dispatched event, or empty for invalid index.
 
std::string getEventPayload (int index) const override
 Payload of a dispatched event, or empty for invalid index.
 
void clearEvents ()
 Clear currently dispatched events. update() also clears them at frame start.
 
eve::Result< void > advance (const eve::SimulationStep &step) override
 Advance playback and sample into internal pose.
 
eve::SimulationTick currentTick () const noexcept override
 Last scheduler tick consumed by the checked playback API.
 
bool hasCurrentTick () const noexcept override
 Whether the player has consumed at least one checked step.
 
void update (float dt)
 Legacy seconds facade retained for scripts and old callers.
 
- Public 成员函数 继承自 eve::animation::IAnimPoseSource
virtual ~IAnimPoseSource ()=default
 Releases IAnimPoseSource resources.
 

详细描述

Single-clip (or cross-fading) 3D animation player. Script type: AnimPlayer.

在文件 AnimPlayer.h 第 30 行定义.

构造及析构函数说明

◆ AnimPlayer() [1/2]

eve::animation::AnimPlayer::AnimPlayer ( AnimSkeleton *  skeleton)
explicit

◆ ~AnimPlayer()

eve::animation::AnimPlayer::~AnimPlayer ( )
overridedefault

Anim player.

◆ AnimPlayer() [2/2]

eve::animation::AnimPlayer::AnimPlayer ( const AnimPlayer &  )
delete

成员函数说明

◆ advance()

eve::Result< void > eve::animation::AnimPlayer::advance ( const eve::SimulationStep &  step)
overridevirtual

◆ clearEvents()

void eve::animation::AnimPlayer::clearEvents ( )
inline

Clear currently dispatched events. update() also clears them at frame start.

在文件 AnimPlayer.h 第 139 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ consumeEvent()

std::string eve::animation::AnimPlayer::consumeEvent ( )

Pop the oldest notify crossed since the previous update.

在文件 AnimPlayer.cpp 第 137 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ crossFade()

void eve::animation::AnimPlayer::crossFade ( AnimClip *  clip,
float  blendSeconds 
)

Cross-fade to clip over blendSeconds (keeps sampling previous until done).

在文件 AnimPlayer.cpp 第 76 行定义.

引用了 clip, eve::animation::AnimPose::copyFrom() , 以及 play().

被这些函数引用 eve::animation::exposeAnimPlayerBindings() , 以及 eve::avatar::AvatarInstance::setMotion().

◆ currentTick()

eve::SimulationTick eve::animation::AnimPlayer::currentTick ( ) const
inlineoverridevirtualnoexcept

Last scheduler tick consumed by the checked playback API.

实现了 eve::animation::IAnimPoseSource.

在文件 AnimPlayer.h 第 145 行定义.

◆ getClip()

AnimClip * eve::animation::AnimPlayer::getClip ( ) const
inline

Borrow the selected clip, or null if none is selected. The caller owns the clip and must keep it alive during playback and this borrow. Playback changes can replace the selected clip; no ownership is transferred. @thread Owner thread only, outside advance; no callbacks or reentrancy.

在文件 AnimPlayer.h 第 86 行定义.

被这些函数引用 eve::animation::AnimSyncGroup::advance() , 以及 eve::animation::exposeAnimPlayerBindings().

◆ getEventCount()

int eve::animation::AnimPlayer::getEventCount ( ) const
inlineoverridevirtual

◆ getEventName()

std::string eve::animation::AnimPlayer::getEventName ( int  index) const
overridevirtual

Name of a dispatched event, or empty for invalid index.

重载 eve::animation::IAnimPoseSource .

在文件 AnimPlayer.cpp 第 150 行定义.

引用了 getEventCount(), index , 以及 name.

被这些函数引用 eve::climbing::advanceClimbingAnimation(), eve::animation::exposeAnimPlayerBindings() , 以及 eve::avatar::AvatarInstance::getAnimationEventName().

◆ getEventPayload()

std::string eve::animation::AnimPlayer::getEventPayload ( int  index) const
overridevirtual

Payload of a dispatched event, or empty for invalid index.

重载 eve::animation::IAnimPoseSource .

在文件 AnimPlayer.cpp 第 155 行定义.

引用了 getEventCount(), index , 以及 payload.

被这些函数引用 eve::animation::exposeAnimPlayerBindings() , 以及 eve::avatar::AvatarInstance::getAnimationEventPayload().

◆ getLoop()

bool eve::animation::AnimPlayer::getLoop ( ) const

Returns the loop.

在文件 AnimPlayer.cpp 第 45 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ getPose()

AnimPose * eve::animation::AnimPlayer::getPose ( )
overridevirtual

Borrowed pointer accessor. @ownership Borrowed @lifetime Valid while the owning animation object remains alive; do not retain across destruction.

实现了 eve::animation::IAnimPoseSource.

在文件 AnimPlayer.cpp 第 114 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ getRootMotionBone()

int eve::animation::AnimPlayer::getRootMotionBone ( ) const
inline

Returns the root motion bone.

在文件 AnimPlayer.h 第 95 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ getRootMotionPolicy()

RootMotionPolicy eve::animation::AnimPlayer::getRootMotionPolicy ( ) const
inline

Copy of the active root-motion policy.

在文件 AnimPlayer.h 第 104 行定义.

◆ getRootMotionRotationW()

float eve::animation::AnimPlayer::getRootMotionRotationW ( ) const
inline

Returns the root motion rotation w.

在文件 AnimPlayer.h 第 124 行定义.

被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().

◆ getRootMotionRotationX()

float eve::animation::AnimPlayer::getRootMotionRotationX ( ) const
inline

Returns the root motion rotation x.

在文件 AnimPlayer.h 第 118 行定义.

被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().

◆ getRootMotionRotationY()

float eve::animation::AnimPlayer::getRootMotionRotationY ( ) const
inline

Returns the root motion rotation y.

在文件 AnimPlayer.h 第 120 行定义.

被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().

◆ getRootMotionRotationZ()

float eve::animation::AnimPlayer::getRootMotionRotationZ ( ) const
inline

Returns the root motion rotation z.

在文件 AnimPlayer.h 第 122 行定义.

被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().

◆ getRootMotionX()

float eve::animation::AnimPlayer::getRootMotionX ( ) const
inline

Controller-facing translation X after policy filtering (BoneLocal or CharacterFacing).

在文件 AnimPlayer.h 第 112 行定义.

被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().

◆ getRootMotionY()

float eve::animation::AnimPlayer::getRootMotionY ( ) const
inline

Returns the root motion y.

在文件 AnimPlayer.h 第 114 行定义.

被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().

◆ getRootMotionZ()

float eve::animation::AnimPlayer::getRootMotionZ ( ) const
inline

Returns the root motion z.

在文件 AnimPlayer.h 第 116 行定义.

被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().

◆ getSkeleton()

AnimSkeleton * eve::animation::AnimPlayer::getSkeleton ( ) const
inlineoverridevirtual

Borrowed pointer accessor. @ownership Borrowed @lifetime Valid while the owning animation object remains alive; do not retain across destruction.

实现了 eve::animation::IAnimPoseSource.

在文件 AnimPlayer.h 第 44 行定义.

被这些函数引用 eve::climbing::beginClimbingAnimation(), eve::climbing::beginClimbingAnimation() , 以及 eve::avatar::AvatarInstance::bindAnimPlayer().

◆ getSpeed()

float eve::animation::AnimPlayer::getSpeed ( ) const
inline

Returns the speed.

在文件 AnimPlayer.h 第 63 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ getTime()

float eve::animation::AnimPlayer::getTime ( ) const
inline

Returns the time.

在文件 AnimPlayer.h 第 67 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ getUpdateRate()

float eve::animation::AnimPlayer::getUpdateRate ( ) const
inline

Returns the update rate.

在文件 AnimPlayer.h 第 130 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ hasCurrentTick()

bool eve::animation::AnimPlayer::hasCurrentTick ( ) const
inlineoverridevirtualnoexcept

Whether the player has consumed at least one checked step.

实现了 eve::animation::IAnimPoseSource.

在文件 AnimPlayer.h 第 147 行定义.

◆ isPaused()

bool eve::animation::AnimPlayer::isPaused ( ) const
inline

True when paused.

在文件 AnimPlayer.h 第 79 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ isPlaying()

bool eve::animation::AnimPlayer::isPlaying ( ) const
inline

◆ operator=()

AnimPlayer & eve::animation::AnimPlayer::operator= ( const AnimPlayer &  )
delete

◆ pause()

void eve::animation::AnimPlayer::pause ( )

Pause.

在文件 AnimPlayer.cpp 第 106 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ play()

◆ resume()

void eve::animation::AnimPlayer::resume ( )

Resume.

在文件 AnimPlayer.cpp 第 110 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ setBlendCurve()

void eve::animation::AnimPlayer::setBlendCurve ( AnimBlendCurve  curve)
inlinenoexcept

Select the curve used by subsequent and active cross-fades.

在文件 AnimPlayer.h 第 51 行定义.

引用了 curve.

◆ setLoop()

void eve::animation::AnimPlayer::setLoop ( bool  loop)
inline

Sets the loop.

在文件 AnimPlayer.h 第 69 行定义.

引用了 loop.

被这些函数引用 eve::climbing::beginClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().

◆ setRootMotionBone()

void eve::animation::AnimPlayer::setRootMotionBone ( int  boneIndex)

Select the bone whose per-frame motion is extracted (default 0).

在文件 AnimPlayer.cpp 第 116 行定义.

引用了 eve::animation::AnimSkeleton::getBoneCount().

被这些函数引用 eve::climbing::beginClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().

◆ setRootMotionCharacterYaw()

eve::Result< void > eve::animation::AnimPlayer::setRootMotionCharacterYaw ( float  yawRadians)

Set CharacterFacing yaw in radians without replacing the rest of the policy.

返回
Applied on success; InvalidArgument when yaw is non-finite.

在文件 AnimPlayer.cpp 第 129 行定义.

引用了 eve::Applied, eve::animation::RootMotionPolicy::characterYaw, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::Status::success() , 以及 eve::Result< T >::success().

◆ setRootMotionPolicy()

eve::Result< void > eve::animation::AnimPlayer::setRootMotionPolicy ( const RootMotionPolicy &  policy)

Replace the root-motion filter/bake/apply policy used by subsequent updates.

返回
Applied on success; InvalidArgument leaves the previous policy unchanged. @thread Owner thread only, outside advance; no callbacks or reentrancy.

在文件 AnimPlayer.cpp 第 122 行定义.

引用了 eve::Applied, eve::Status::success(), eve::Result< T >::success() , 以及 eve::animation::validateRootMotionPolicy().

◆ setSpeed()

void eve::animation::AnimPlayer::setSpeed ( float  speed)

Sets the speed.

在文件 AnimPlayer.cpp 第 47 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ setTime()

void eve::animation::AnimPlayer::setTime ( float  seconds)

Sets the time.

在文件 AnimPlayer.cpp 第 52 行定义.

引用了 eve::animation::AnimClip::sample().

被这些函数引用 eve::animation::AnimSyncGroup::advance() , 以及 eve::animation::exposeAnimPlayerBindings().

◆ setUpdateRate()

void eve::animation::AnimPlayer::setUpdateRate ( float  hz)

Limit pose evaluation frequency for animation LOD; 0 updates every call.

在文件 AnimPlayer.cpp 第 144 行定义.

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ stop()

void eve::animation::AnimPlayer::stop ( )

Stops .

在文件 AnimPlayer.cpp 第 95 行定义.

引用了 eve::animation::AnimSkeleton::applyBindPose().

被这些函数引用 eve::animation::exposeAnimPlayerBindings().

◆ update()

void eve::animation::AnimPlayer::update ( float  dt)

该类的文档由以下文件生成: