Evaluated local (and optional world) pose for an AnimSkeleton. Script type: AnimPose.
更多...
#include <AnimPose.h>
Public 成员函数 | |
| AnimPose ()=default | |
| Anim pose. | |
| AnimPose (int boneCount) | |
| Anim pose. | |
| ~AnimPose ()=default | |
| Anim pose. | |
| AnimPose (const AnimPose &)=delete | |
| AnimPose & | operator= (const AnimPose &)=delete |
| AnimPose (AnimPose &&) noexcept=default | |
| Anim pose. | |
| AnimPose & | operator= (AnimPose &&) noexcept=default |
| Operator =. | |
| void | resize (int boneCount) |
| Resize. | |
| int | getBoneCount () const |
| Returns the bone count. | |
| void | copyFrom (const AnimPose *other) |
| Copies from. | |
| void | blendFrom (const AnimPose *a, const AnimPose *b, float t) |
| Blend from. | |
| void | setLocalPosition (int boneIndex, float x, float y, float z) |
| Sets the local position. | |
| void | setLocalRotation (int boneIndex, float x, float y, float z, float w) |
| Sets the local rotation. | |
| void | setLocalScale (int boneIndex, float x, float y, float z) |
| Sets the local scale. | |
| float | getLocalPositionX (int boneIndex) const |
| Returns the local position x. | |
| float | getLocalPositionY (int boneIndex) const |
| Returns the local position y. | |
| float | getLocalPositionZ (int boneIndex) const |
| Returns the local position z. | |
| float | getLocalRotationX (int boneIndex) const |
| Returns the local rotation x. | |
| float | getLocalRotationY (int boneIndex) const |
| Returns the local rotation y. | |
| float | getLocalRotationZ (int boneIndex) const |
| Returns the local rotation z. | |
| float | getLocalRotationW (int boneIndex) const |
| Returns the local rotation w. | |
| float | getLocalScaleX (int boneIndex) const |
| Returns the local scale x. | |
| float | getLocalScaleY (int boneIndex) const |
| Returns the local scale y. | |
| float | getLocalScaleZ (int boneIndex) const |
| Returns the local scale z. | |
| void | computeWorld (const AnimSkeleton *skeleton) |
| Compute world transforms from local pose + skeleton hierarchy. World values readable via getWorld* after this call. | |
| bool | aimBone (const AnimSkeleton *skeleton, int boneIndex, float targetX, float targetY, float targetZ, float weight=1.f) |
| Rotate a bone so its local +Z axis aims at a world-space target. | |
| bool | solveTwoBoneIK (const AnimSkeleton *skeleton, int rootBone, int midBone, int tipBone, float targetX, float targetY, float targetZ, float weight=1.f) |
| Analytically solve a root-mid-tip chain toward a world-space target. | |
| float | getWorldPositionX (int boneIndex) const |
| Returns the world position x. | |
| float | getWorldPositionY (int boneIndex) const |
| Returns the world position y. | |
| float | getWorldPositionZ (int boneIndex) const |
| Returns the world position z. | |
| float | getWorldRotationX (int boneIndex) const |
| Returns the world rotation x. | |
| float | getWorldRotationY (int boneIndex) const |
| Returns the world rotation y. | |
| float | getWorldRotationZ (int boneIndex) const |
| Returns the world rotation z. | |
| float | getWorldRotationW (int boneIndex) const |
| Returns the world rotation w. | |
| float | getWorldMatrixElement (int boneIndex, int elementIndex) const |
| Column-major 4x4 world matrix for boneIndex after computeWorld(). elementIndex in [0, 15]. Used by CPU skinning (AnimSkin). | |
| void | getWorldMatrix (int boneIndex, float *out16) const |
| Write 16 floats (column-major) into out16 (must not be null). | |
| TransformTRS & | local (int boneIndex) |
| Local. | |
| const TransformTRS & | local (int boneIndex) const |
| Local. | |
| const TransformTRS & | world (int boneIndex) const |
| World. | |
详细描述
Evaluated local (and optional world) pose for an AnimSkeleton. Script type: AnimPose.
在文件 AnimPose.h 第 17 行定义.
构造及析构函数说明
◆ AnimPose() [1/4]
|
default |
Anim pose.
◆ AnimPose() [2/4]
|
explicit |
◆ ~AnimPose()
|
default |
Anim pose.
◆ AnimPose() [3/4]
|
delete |
◆ AnimPose() [4/4]
|
defaultnoexcept |
Anim pose.
成员函数说明
◆ aimBone()
| bool eve::animation::AnimPose::aimBone | ( | const AnimSkeleton * | skeleton, |
| int | boneIndex, | ||
| float | targetX, | ||
| float | targetY, | ||
| float | targetZ, | ||
| float | weight = 1.f |
||
| ) |
Rotate a bone so its local +Z axis aims at a world-space target.
- 参数
-
skeleton Skeleton defining the hierarchy. boneIndex Bone to rotate. targetX World-space target X.
- 参数
-
targetY World-space target Y. targetZ World-space target Z. weight Blend weight in [0, 1].
- 返回
- False when the target is coincident with the bone, otherwise true.
在文件 AnimPose.cpp 第 220 行定义.
引用了 bone, computeWorld(), eve::animation::Mat4::fromTRS(), local, eve::animation::Mat4::m, targetX, weight , 以及 world.
◆ blendFrom()
Blend from.
在文件 AnimPose.cpp 第 97 行定义.
引用了 a, b, eve::animation::clampf(), getBoneCount(), eve::animation::lerpf(), eve::animation::TransformTRS::px, eve::animation::TransformTRS::py, eve::animation::TransformTRS::pz, eve::animation::TransformTRS::qw, eve::animation::TransformTRS::qx, eve::animation::TransformTRS::qy, eve::animation::TransformTRS::qz, resize(), eve::animation::slerpQuat(), eve::animation::TransformTRS::sx, eve::animation::TransformTRS::sy, eve::animation::TransformTRS::sz, t, values , 以及 weight.
◆ computeWorld()
| void eve::animation::AnimPose::computeWorld | ( | const AnimSkeleton * | skeleton | ) |
Compute world transforms from local pose + skeleton hierarchy. World values readable via getWorld* after this call.
在文件 AnimPose.cpp 第 203 行定义.
引用了 getBoneCount(), eve::animation::AnimSkeleton::getBoneCount(), eve::animation::AnimSkeleton::getParent(), eve::animation::detail::mulTRS() , 以及 parent.
被这些函数引用 aimBone(), eve::animation::PhysicalBalancePose::applyImpulse(), eve::animation::buildSmrFeatures(), eve::avatar::VrmRuntime::gaze(), eve::animation::AnimClip::retargetWithProfile(), eve::animation::MotionMatcher::setFeatureQuery() , 以及 solveTwoBoneIK().
◆ copyFrom()
| void eve::animation::AnimPose::copyFrom | ( | const AnimPose * | other | ) |
Copies from.
在文件 AnimPose.cpp 第 91 行定义.
被这些函数引用 eve::animation::AnimPlayer::crossFade(), eve::animation::exposeAnimInertializerBindings(), eve::animation::detail::PoseInertia::remember(), eve::animation::MotionMatcher::search(), eve::animation::MotionMatcher::setFeatureQuery(), eve::animation::MotionMatcher::setQueryPose(), eve::animation::ControlPose::setTargetPose() , 以及 eve::animation::PhysicalBalancePose::setTargetPose().
◆ getBoneCount()
|
inline |
Returns the bone count.
在文件 AnimPose.h 第 36 行定义.
被这些函数引用 eve::animation::detail::PoseInertia::begin(), blendFrom(), eve::animation::MontageCoordinator::compose(), computeWorld(), resize(), eve::animation::MotionMatcher::setLocomotionQuery() , 以及 eve::animation::MotionMatcher::setQueryPose().
◆ getLocalPositionX()
| float eve::animation::AnimPose::getLocalPositionX | ( | int | boneIndex | ) | const |
◆ getLocalPositionY()
| float eve::animation::AnimPose::getLocalPositionY | ( | int | boneIndex | ) | const |
◆ getLocalPositionZ()
| float eve::animation::AnimPose::getLocalPositionZ | ( | int | boneIndex | ) | const |
◆ getLocalRotationW()
| float eve::animation::AnimPose::getLocalRotationW | ( | int | boneIndex | ) | const |
◆ getLocalRotationX()
| float eve::animation::AnimPose::getLocalRotationX | ( | int | boneIndex | ) | const |
◆ getLocalRotationY()
| float eve::animation::AnimPose::getLocalRotationY | ( | int | boneIndex | ) | const |
◆ getLocalRotationZ()
| float eve::animation::AnimPose::getLocalRotationZ | ( | int | boneIndex | ) | const |
◆ getLocalScaleX()
| float eve::animation::AnimPose::getLocalScaleX | ( | int | boneIndex | ) | const |
◆ getLocalScaleY()
| float eve::animation::AnimPose::getLocalScaleY | ( | int | boneIndex | ) | const |
◆ getLocalScaleZ()
| float eve::animation::AnimPose::getLocalScaleZ | ( | int | boneIndex | ) | const |
◆ getWorldMatrix()
| void eve::animation::AnimPose::getWorldMatrix | ( | int | boneIndex, |
| float * | out16 | ||
| ) | const |
Write 16 floats (column-major) into out16 (must not be null).
在文件 AnimPose.cpp 第 381 行定义.
引用了 eve::animation::Mat4::fromTRS() , 以及 eve::animation::Mat4::m.
◆ getWorldMatrixElement()
| float eve::animation::AnimPose::getWorldMatrixElement | ( | int | boneIndex, |
| int | elementIndex | ||
| ) | const |
Column-major 4x4 world matrix for boneIndex after computeWorld(). elementIndex in [0, 15]. Used by CPU skinning (AnimSkin).
在文件 AnimPose.cpp 第 372 行定义.
引用了 eve::animation::Mat4::fromTRS() , 以及 eve::animation::Mat4::m.
◆ getWorldPositionX()
| float eve::animation::AnimPose::getWorldPositionX | ( | int | boneIndex | ) | const |
◆ getWorldPositionY()
| float eve::animation::AnimPose::getWorldPositionY | ( | int | boneIndex | ) | const |
◆ getWorldPositionZ()
| float eve::animation::AnimPose::getWorldPositionZ | ( | int | boneIndex | ) | const |
◆ getWorldRotationW()
| float eve::animation::AnimPose::getWorldRotationW | ( | int | boneIndex | ) | const |
◆ getWorldRotationX()
| float eve::animation::AnimPose::getWorldRotationX | ( | int | boneIndex | ) | const |
◆ getWorldRotationY()
| float eve::animation::AnimPose::getWorldRotationY | ( | int | boneIndex | ) | const |
◆ getWorldRotationZ()
| float eve::animation::AnimPose::getWorldRotationZ | ( | int | boneIndex | ) | const |
◆ local() [1/2]
| TransformTRS & eve::animation::AnimPose::local | ( | int | boneIndex | ) |
Local.
在文件 AnimPose.cpp 第 126 行定义.
被这些函数引用 eve::animation::detail::PoseInertia::begin(), eve::animation::AnimClip::retargetWithProfile() , 以及 eve::animation::AnimClip::sampleLod().
◆ local() [2/2]
| const TransformTRS & eve::animation::AnimPose::local | ( | int | boneIndex | ) | const |
Local.
在文件 AnimPose.cpp 第 131 行定义.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ resize()
| void eve::animation::AnimPose::resize | ( | int | boneCount | ) |
Resize.
在文件 AnimPose.cpp 第 78 行定义.
引用了 getBoneCount() , 以及 eve::animation::TransformTRS::identity().
被这些函数引用 eve::animation::AnimGraph::AnimGraph(), eve::animation::AnimLayerMixer::AnimLayerMixer(), eve::animation::AnimPlayer::AnimPlayer(), AnimPose(), eve::animation::AnimStateMachine::AnimStateMachine(), blendFrom(), eve::animation::MotionDatabase::MotionDatabase(), eve::animation::MotionMatcher::MotionMatcher() , 以及 eve::animation::AnimClip::sampleLod().
◆ setLocalPosition()
| void eve::animation::AnimPose::setLocalPosition | ( | int | boneIndex, |
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
◆ setLocalRotation()
| void eve::animation::AnimPose::setLocalRotation | ( | int | boneIndex, |
| float | x, | ||
| float | y, | ||
| float | z, | ||
| float | w | ||
| ) |
◆ setLocalScale()
| void eve::animation::AnimPose::setLocalScale | ( | int | boneIndex, |
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
◆ solveTwoBoneIK()
| bool eve::animation::AnimPose::solveTwoBoneIK | ( | const AnimSkeleton * | skeleton, |
| int | rootBone, | ||
| int | midBone, | ||
| int | tipBone, | ||
| float | targetX, | ||
| float | targetY, | ||
| float | targetZ, | ||
| float | weight = 1.f |
||
| ) |
Analytically solve a root-mid-tip chain toward a world-space target.
Preserves segment lengths and the current bend plane, with a deterministic plane for a straight chain. Unreachable targets clamp to the chain's reach; full-weight reachable targets are exact up to float rounding for rigid/uniformly scaled chains. Blends solved local rotations once, then updates world transforms.
- 参数
-
skeleton Skeleton defining the hierarchy. rootBone Root joint index. midBone Middle joint index. tipBone End-effector index. targetX World-space target X. targetY World-space target Y. targetZ World-space target Z. weight Blend weight in [0, 1].
- 返回
- False for an invalid chain or zero-length segment, otherwise true. Nonfinite targets/weights throw before changing local transforms.
在文件 AnimPose.cpp 第 237 行定义.
引用了 computeWorld(), targetX, weight , 以及 world.
◆ world()
| const TransformTRS & eve::animation::AnimPose::world | ( | int | boneIndex | ) | const |
该类的文档由以下文件生成:
- src/modules/animation/AnimPose.h
- src/modules/animation/AnimPose.cpp