Single-clip (or cross-fading) 3D animation player. Script type: AnimPlayer.
更多...
#include <AnimPlayer.h>
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]
|
explicit |
Anim player.
在文件 AnimPlayer.cpp 第 29 行定义.
引用了 eve::animation::AnimSkeleton::applyBindPose(), eve::animation::AnimSkeleton::getBoneCount() , 以及 eve::animation::AnimPose::resize().
◆ ~AnimPlayer()
|
overridedefault |
Anim player.
◆ AnimPlayer() [2/2]
|
delete |
成员函数说明
◆ advance()
|
overridevirtual |
Advance playback and sample into internal pose.
实现了 eve::animation::IAnimPoseSource.
在文件 AnimPlayer.cpp 第 251 行定义.
引用了 eve::Applied, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, step, eve::Status::success() , 以及 eve::Result< T >::success().
被这些函数引用 eve::animation::AnimSyncGroup::advance(), eve::climbing::advanceClimbingAnimation() , 以及 update().
◆ clearEvents()
|
inline |
Clear currently dispatched events. update() also clears them at frame start.
在文件 AnimPlayer.h 第 139 行定义.
◆ consumeEvent()
| std::string eve::animation::AnimPlayer::consumeEvent | ( | ) |
Pop the oldest notify crossed since the previous update.
在文件 AnimPlayer.cpp 第 137 行定义.
◆ 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()
|
inlineoverridevirtualnoexcept |
Last scheduler tick consumed by the checked playback API.
实现了 eve::animation::IAnimPoseSource.
在文件 AnimPlayer.h 第 145 行定义.
◆ getClip()
|
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()
|
inlineoverridevirtual |
Number of events crossed by the most recent play/update call.
重载 eve::animation::IAnimPoseSource .
在文件 AnimPlayer.h 第 133 行定义.
被这些函数引用 eve::climbing::advanceClimbingAnimation(), eve::animation::exposeAnimPlayerBindings(), eve::avatar::AvatarInstance::getAnimationEventCount(), eve::avatar::AvatarInstance::getAnimationEventLayer(), getEventName() , 以及 getEventPayload().
◆ getEventName()
|
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()
|
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 |
◆ 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 行定义.
◆ getRootMotionBone()
|
inline |
Returns the root motion bone.
在文件 AnimPlayer.h 第 95 行定义.
◆ getRootMotionPolicy()
|
inline |
Copy of the active root-motion policy.
在文件 AnimPlayer.h 第 104 行定义.
◆ getRootMotionRotationW()
|
inline |
Returns the root motion rotation w.
在文件 AnimPlayer.h 第 124 行定义.
被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().
◆ getRootMotionRotationX()
|
inline |
Returns the root motion rotation x.
在文件 AnimPlayer.h 第 118 行定义.
被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().
◆ getRootMotionRotationY()
|
inline |
Returns the root motion rotation y.
在文件 AnimPlayer.h 第 120 行定义.
被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().
◆ getRootMotionRotationZ()
|
inline |
Returns the root motion rotation z.
在文件 AnimPlayer.h 第 122 行定义.
被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().
◆ getRootMotionX()
|
inline |
Controller-facing translation X after policy filtering (BoneLocal or CharacterFacing).
在文件 AnimPlayer.h 第 112 行定义.
被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().
◆ getRootMotionY()
|
inline |
Returns the root motion y.
在文件 AnimPlayer.h 第 114 行定义.
被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().
◆ getRootMotionZ()
|
inline |
Returns the root motion z.
在文件 AnimPlayer.h 第 116 行定义.
被这些函数引用 eve::climbing::advanceClimbingAnimation() , 以及 eve::animation::exposeAnimPlayerBindings().
◆ getSkeleton()
|
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()
|
inline |
◆ getTime()
|
inline |
◆ getUpdateRate()
|
inline |
Returns the update rate.
在文件 AnimPlayer.h 第 130 行定义.
◆ hasCurrentTick()
|
inlineoverridevirtualnoexcept |
Whether the player has consumed at least one checked step.
实现了 eve::animation::IAnimPoseSource.
在文件 AnimPlayer.h 第 147 行定义.
◆ isPaused()
|
inline |
◆ isPlaying()
|
inline |
True when playing.
在文件 AnimPlayer.h 第 77 行定义.
被这些函数引用 eve::climbing::advanceClimbingAnimation(), eve::animation::exposeAnimPlayerBindings() , 以及 eve::avatar::AvatarInstance::setMotion().
◆ operator=()
|
delete |
◆ pause()
| void eve::animation::AnimPlayer::pause | ( | ) |
◆ play()
| void eve::animation::AnimPlayer::play | ( | AnimClip * | clip | ) |
Play.
在文件 AnimPlayer.cpp 第 60 行定义.
引用了 clip, eve::animation::AnimClip::getEventCount(), eve::animation::AnimClip::getEventName(), eve::animation::AnimClip::getEventPayload(), eve::animation::AnimClip::getEventTime() , 以及 eve::animation::AnimClip::sample().
被这些函数引用 eve::climbing::beginClimbingAnimation(), crossFade(), eve::animation::exposeAnimPlayerBindings() , 以及 eve::avatar::AvatarInstance::setMotion().
◆ resume()
| void eve::animation::AnimPlayer::resume | ( | ) |
◆ setBlendCurve()
|
inlinenoexcept |
◆ setLoop()
|
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 | ) |
◆ 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 行定义.
◆ stop()
| void eve::animation::AnimPlayer::stop | ( | ) |
◆ update()
| void eve::animation::AnimPlayer::update | ( | float | dt | ) |
Legacy seconds facade retained for scripts and old callers.
在文件 AnimPlayer.cpp 第 269 行定义.
引用了 advance(), duration, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::Duration::fromSeconds(), eve::Result< T >::ignore(), eve::detail::StrongUint64< Tag >::incremented() , 以及 eve::InvariantViolation.
该类的文档由以下文件生成:
- src/modules/animation/AnimPlayer.h
- src/modules/animation/AnimPlayer.cpp
Public 成员函数 继承自