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

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]

eve::animation::AnimPose::AnimPose ( )
default

Anim pose.

◆ AnimPose() [2/4]

eve::animation::AnimPose::AnimPose ( int  boneCount)
explicit

Anim pose.

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

引用了 resize().

◆ ~AnimPose()

eve::animation::AnimPose::~AnimPose ( )
default

Anim pose.

◆ AnimPose() [3/4]

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

◆ AnimPose() [4/4]

eve::animation::AnimPose::AnimPose ( AnimPose &&  )
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.

参数
skeletonSkeleton defining the hierarchy.
boneIndexBone to rotate.
targetXWorld-space target X.
  • 参数
    targetYWorld-space target Y.
    targetZWorld-space target Z.
    weightBlend 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()

◆ computeWorld()

void eve::animation::AnimPose::computeWorld ( const AnimSkeleton *  skeleton)

◆ copyFrom()

◆ getBoneCount()

int eve::animation::AnimPose::getBoneCount ( ) const
inline

◆ getLocalPositionX()

float eve::animation::AnimPose::getLocalPositionX ( int  boneIndex) const

Returns the local position x.

在文件 AnimPose.cpp 第 162 行定义.

引用了 px.

◆ getLocalPositionY()

float eve::animation::AnimPose::getLocalPositionY ( int  boneIndex) const

Returns the local position y.

在文件 AnimPose.cpp 第 166 行定义.

引用了 py.

◆ getLocalPositionZ()

float eve::animation::AnimPose::getLocalPositionZ ( int  boneIndex) const

Returns the local position z.

在文件 AnimPose.cpp 第 170 行定义.

引用了 pz.

◆ getLocalRotationW()

float eve::animation::AnimPose::getLocalRotationW ( int  boneIndex) const

Returns the local rotation w.

在文件 AnimPose.cpp 第 186 行定义.

引用了 qw.

◆ getLocalRotationX()

float eve::animation::AnimPose::getLocalRotationX ( int  boneIndex) const

Returns the local rotation x.

在文件 AnimPose.cpp 第 174 行定义.

引用了 qx.

◆ getLocalRotationY()

float eve::animation::AnimPose::getLocalRotationY ( int  boneIndex) const

Returns the local rotation y.

在文件 AnimPose.cpp 第 178 行定义.

引用了 qy.

◆ getLocalRotationZ()

float eve::animation::AnimPose::getLocalRotationZ ( int  boneIndex) const

Returns the local rotation z.

在文件 AnimPose.cpp 第 182 行定义.

引用了 qz.

◆ getLocalScaleX()

float eve::animation::AnimPose::getLocalScaleX ( int  boneIndex) const

Returns the local scale x.

在文件 AnimPose.cpp 第 190 行定义.

引用了 sx.

◆ getLocalScaleY()

float eve::animation::AnimPose::getLocalScaleY ( int  boneIndex) const

Returns the local scale y.

在文件 AnimPose.cpp 第 194 行定义.

引用了 sy.

◆ getLocalScaleZ()

float eve::animation::AnimPose::getLocalScaleZ ( int  boneIndex) const

Returns the local scale z.

在文件 AnimPose.cpp 第 198 行定义.

引用了 sz.

◆ 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

Returns the world position x.

在文件 AnimPose.cpp 第 338 行定义.

引用了 px.

◆ getWorldPositionY()

float eve::animation::AnimPose::getWorldPositionY ( int  boneIndex) const

Returns the world position y.

在文件 AnimPose.cpp 第 342 行定义.

引用了 py.

◆ getWorldPositionZ()

float eve::animation::AnimPose::getWorldPositionZ ( int  boneIndex) const

Returns the world position z.

在文件 AnimPose.cpp 第 346 行定义.

引用了 pz.

◆ getWorldRotationW()

float eve::animation::AnimPose::getWorldRotationW ( int  boneIndex) const

Returns the world rotation w.

在文件 AnimPose.cpp 第 362 行定义.

引用了 qw.

◆ getWorldRotationX()

float eve::animation::AnimPose::getWorldRotationX ( int  boneIndex) const

Returns the world rotation x.

在文件 AnimPose.cpp 第 350 行定义.

引用了 qx.

◆ getWorldRotationY()

float eve::animation::AnimPose::getWorldRotationY ( int  boneIndex) const

Returns the world rotation y.

在文件 AnimPose.cpp 第 354 行定义.

引用了 qy.

◆ getWorldRotationZ()

float eve::animation::AnimPose::getWorldRotationZ ( int  boneIndex) const

Returns the world rotation z.

在文件 AnimPose.cpp 第 358 行定义.

引用了 qz.

◆ local() [1/2]

TransformTRS & eve::animation::AnimPose::local ( int  boneIndex)

◆ local() [2/2]

const TransformTRS & eve::animation::AnimPose::local ( int  boneIndex) const

Local.

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

◆ operator=() [1/2]

AnimPose & eve::animation::AnimPose::operator= ( AnimPose &&  )
defaultnoexcept

Operator =.

◆ operator=() [2/2]

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

◆ resize()

◆ setLocalPosition()

void eve::animation::AnimPose::setLocalPosition ( int  boneIndex,
float  x,
float  y,
float  z 
)

Sets the local position.

在文件 AnimPose.cpp 第 136 行定义.

引用了 t, x, y , 以及 z.

◆ setLocalRotation()

void eve::animation::AnimPose::setLocalRotation ( int  boneIndex,
float  x,
float  y,
float  z,
float  w 
)

Sets the local rotation.

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

引用了 t, w, x, y , 以及 z.

◆ setLocalScale()

void eve::animation::AnimPose::setLocalScale ( int  boneIndex,
float  x,
float  y,
float  z 
)

Sets the local scale.

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

引用了 t, x, y , 以及 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.

参数
skeletonSkeleton defining the hierarchy.
rootBoneRoot joint index.
midBoneMiddle joint index.
tipBoneEnd-effector index.
targetXWorld-space target X.
targetYWorld-space target Y.
targetZWorld-space target Z.
weightBlend 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

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