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

Planar orientation warp applied after motion matching, never fed back into search. 更多...

#include <OrientationWarping.h>

类

struct  Impl
 

Public 成员函数

 OrientationWarping ()
 Construct an unconfigured warper with no borrowed skeleton.
 
 ~OrientationWarping ()
 Release owned interpolation state; the borrowed skeleton is not accessed.
 
 OrientationWarping (const OrientationWarping &)=delete
 
OrientationWarping & operator= (const OrientationWarping &)=delete
 
eve::Result< void > configure (AnimSkeleton &skeleton, int rootBone, std::span< const int > spineBones={}, std::span< const int > ikBones={})
 Atomically bind a skeleton and bone lists used by later apply calls.
 
eve::Result< void > setDistributedAlpha (float alpha)
 Set how much of the warp is distributed onto the spine chain.
 
float getDistributedAlpha () const
 
eve::Result< void > setAngleThreshold (float radians)
 Set the inclusive planar-angle magnitude that disables warping.
 
float getAngleThreshold () const
 
eve::Result< void > setRotationInterpSpeed (float speed)
 Set how quickly the applied yaw approaches the target, matching Unreal FInterpTo.
 
float getRotationInterpSpeed () const
 
eve::Result< void > setMinRootMotionSpeed (float metresPerSecond)
 Set the planar speed below which either direction is treated as stationary.
 
float getMinRootMotionSpeed () const
 
void setEnabled (bool enabled)
 Enable or disable pose mutation. Disabled apply calls still recompute the target.
 
bool isEnabled () const
 True when enabled.
 
void reset ()
 Clear smoothed yaw so the next apply starts from zero.
 
eve::Result< void > apply (AnimPose &pose, float locomotionX, float locomotionZ, float animatedX, float animatedZ, float dt)
 Warp a local pose so animated planar velocity aligns with locomotion velocity.
 
float getAppliedAngle () const
 Smoothed yaw last applied to a pose, radians, positive from +Z toward +X.
 
float getTargetAngle () const
 Unsmoothed target yaw from the last successful apply, radians.
 
AnimSkeleton * getSkeleton () const
 Borrowed skeleton from the last successful configure, or null. @ownership Borrowed; ownership remains with the caller. @lifetime Valid until the next successful configure or destruction.
 
int getRootBone () const
 Returns the root bone.
 
int getSpineBoneCount () const
 Returns the spine bone count.
 
int getIkBoneCount () const
 Returns the ik bone count.
 

详细描述

Planar orientation warp applied after motion matching, never fed back into search.

Aligns an authored clip's planar displacement with a locomotion direction by adding world-Y rotation. Root receives (1 - distributedAlpha) * angle; remaining yaw is split equally across the configured spine chain. Optional IK bones restore their pre-warp world orientation so separate foot targets stay animation-owned. Magnitude above the angle threshold, or either planar speed below the minimum, targets zero instead of twisting through a pivot. Interpolation uses injected simulation time. @thread Owner simulation thread only; not reentrant; no callbacks. @ownership The warper owns interpolation state. The skeleton is borrowed and must outlive this object after a successful configure. Apply copies the input pose internally and publishes only on success; failed calls leave the caller's pose and prior warp unchanged.

在文件 OrientationWarping.h 第 26 行定义.

构造及析构函数说明

◆ OrientationWarping() [1/2]

eve::animation::OrientationWarping::OrientationWarping ( )

Construct an unconfigured warper with no borrowed skeleton.

在文件 OrientationWarping.cpp 第 86 行定义.

◆ ~OrientationWarping()

eve::animation::OrientationWarping::~OrientationWarping ( )
default

Release owned interpolation state; the borrowed skeleton is not accessed.

◆ OrientationWarping() [2/2]

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

成员函数说明

◆ apply()

eve::Result< void > eve::animation::OrientationWarping::apply ( AnimPose &  pose,
float  locomotionX,
float  locomotionZ,
float  animatedX,
float  animatedZ,
float  dt 
)

Warp a local pose so animated planar velocity aligns with locomotion velocity.

参数
poseLocal pose matching the configured skeleton; mutated only on success.
locomotionXDesired planar velocity X in the same space as the pose, metres/second.
locomotionZDesired planar velocity Z in the same space as the pose, metres/second.
animatedXAuthored root-motion velocity X from the unwarped pose, metres/second.
animatedZAuthored root-motion velocity Z from the unwarped pose, metres/second.
dtFinite nonnegative simulation step in seconds, at most one second.
返回
Applied, NoOp when disabled, or InvalidArgument leaving pose and warp unchanged.

Values must be finite. Search must keep reading the unwarped matcher pose; copy it into a display pose before calling this. Deterministic for the same pose, directions, dt and prior smoothed angle within floating-point tolerance.

在文件 OrientationWarping.cpp 第 159 行定义.

引用了 angle, eve::Applied, bone, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::NoOp, ok, pose, qw, qx, qy, qz, t, target, value , 以及 world.

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

◆ configure()

eve::Result< void > eve::animation::OrientationWarping::configure ( AnimSkeleton &  skeleton,
int  rootBone,
std::span< const int >  spineBones = {},
std::span< const int >  ikBones = {} 
)

Atomically bind a skeleton and bone lists used by later apply calls.

参数
skeletonBorrowed hierarchy; must outlive this warper until the next configure.
rootBoneIndex of the bone that receives the root share of the yaw.
spineBonesOrdered parent-to-child chain that shares the remaining yaw; copied.
ikBonesBones whose world orientation is restored after the body warp; copied.
返回
Applied, or InvalidArgument leaving the previous configuration and warp state.

At most 32 spine bones and 16 IK bones. Indices must be valid, unique, and distinct from the root. Empty spine or IK lists are valid. No input pointers are retained.

在文件 OrientationWarping.cpp 第 89 行定义.

引用了 eve::Applied, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::animation::AnimSkeleton::getBoneCount(), eve::InvalidArgument , 以及 ok.

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

◆ getAngleThreshold()

float eve::animation::OrientationWarping::getAngleThreshold ( ) const

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

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

◆ getAppliedAngle()

float eve::animation::OrientationWarping::getAppliedAngle ( ) const

Smoothed yaw last applied to a pose, radians, positive from +Z toward +X.

在文件 OrientationWarping.cpp 第 226 行定义.

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

◆ getDistributedAlpha()

float eve::animation::OrientationWarping::getDistributedAlpha ( ) const

在文件 OrientationWarping.cpp 第 119 行定义.

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

◆ getIkBoneCount()

int eve::animation::OrientationWarping::getIkBoneCount ( ) const

Returns the ik bone count.

在文件 OrientationWarping.cpp 第 231 行定义.

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

◆ getMinRootMotionSpeed()

float eve::animation::OrientationWarping::getMinRootMotionSpeed ( ) const

在文件 OrientationWarping.cpp 第 149 行定义.

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

◆ getRootBone()

int eve::animation::OrientationWarping::getRootBone ( ) const

Returns the root bone.

在文件 OrientationWarping.cpp 第 229 行定义.

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

◆ getRotationInterpSpeed()

float eve::animation::OrientationWarping::getRotationInterpSpeed ( ) const

在文件 OrientationWarping.cpp 第 139 行定义.

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

◆ getSkeleton()

AnimSkeleton * eve::animation::OrientationWarping::getSkeleton ( ) const

Borrowed skeleton from the last successful configure, or null. @ownership Borrowed; ownership remains with the caller. @lifetime Valid until the next successful configure or destruction.

在文件 OrientationWarping.cpp 第 228 行定义.

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

◆ getSpineBoneCount()

int eve::animation::OrientationWarping::getSpineBoneCount ( ) const

Returns the spine bone count.

在文件 OrientationWarping.cpp 第 230 行定义.

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

◆ getTargetAngle()

float eve::animation::OrientationWarping::getTargetAngle ( ) const

Unsmoothed target yaw from the last successful apply, radians.

在文件 OrientationWarping.cpp 第 227 行定义.

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

◆ isEnabled()

bool eve::animation::OrientationWarping::isEnabled ( ) const

True when enabled.

在文件 OrientationWarping.cpp 第 152 行定义.

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

◆ operator=()

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

◆ reset()

void eve::animation::OrientationWarping::reset ( )

Clear smoothed yaw so the next apply starts from zero.

在文件 OrientationWarping.cpp 第 154 行定义.

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

◆ setAngleThreshold()

eve::Result< void > eve::animation::OrientationWarping::setAngleThreshold ( float  radians)

Set the inclusive planar-angle magnitude that disables warping.

参数
radiansFinite value in (0, pi]. Default is 135 degrees.
返回
Applied, or InvalidArgument without changing the previous threshold.

在文件 OrientationWarping.cpp 第 121 行定义.

引用了 eve::Applied, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 ok.

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

◆ setDistributedAlpha()

eve::Result< void > eve::animation::OrientationWarping::setDistributedAlpha ( float  alpha)

Set how much of the warp is distributed onto the spine chain.

参数
alphaFinite value in [0, 1]. Zero applies the full yaw to the root.
返回
Applied, or InvalidArgument without changing the previous alpha.

在文件 OrientationWarping.cpp 第 112 行定义.

引用了 eve::Applied, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 ok.

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

◆ setEnabled()

void eve::animation::OrientationWarping::setEnabled ( bool  enabled)

Enable or disable pose mutation. Disabled apply calls still recompute the target.

在文件 OrientationWarping.cpp 第 151 行定义.

引用了 enabled.

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

◆ setMinRootMotionSpeed()

eve::Result< void > eve::animation::OrientationWarping::setMinRootMotionSpeed ( float  metresPerSecond)

Set the planar speed below which either direction is treated as stationary.

参数
metresPerSecondFinite value in [0, 100]. Default is 0.1 m/s.
返回
Applied, or InvalidArgument without changing the previous minimum.

在文件 OrientationWarping.cpp 第 141 行定义.

引用了 eve::Applied, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 ok.

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

◆ setRotationInterpSpeed()

eve::Result< void > eve::animation::OrientationWarping::setRotationInterpSpeed ( float  speed)

Set how quickly the applied yaw approaches the target, matching Unreal FInterpTo.

参数
speedFinite value in [0, 100] (1/seconds). Zero snaps every apply.
返回
Applied, or InvalidArgument without changing the previous speed.

在文件 OrientationWarping.cpp 第 131 行定义.

引用了 eve::Applied, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 ok.

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


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