28 int getBoneCount()
const;
32 int getParent(
int boneId)
const;
34 int getChildCount(
int boneId)
const;
36 int getChild(
int boneId,
int childIndex)
const;
39 float getLength(
int boneId)
const;
41 void setLength(
int boneId,
float length);
44 void setPosition(
int boneId,
float x,
float y);
46 float getX(
int boneId)
const;
48 float getY(
int boneId)
const;
51 void setOrientation(
int boneId,
float x,
float y);
53 float getOrientationX(
int boneId)
const;
55 float getOrientationY(
int boneId)
const;
58 void setRotation(
int boneId,
float angle);
60 float getRotation(
int boneId)
const;
63 void setConstraints(
int boneId,
float minAngle,
float maxAngle);
65 void clearConstraints(
int boneId);
67 bool hasConstraints(
int boneId)
const;
70 void initStraightPose(
float rootX = 0.f,
float rootY = 0.f);
74 void forwardKinematics();
76 void updateRotations();
79 float totalLengthTo(
int boneId)
const;
81 ::ik::skeleton2d &
native() {
return sk_; }
82 ::ik::ecs2d &
state() {
return state_; }
83 const ::ik::skeleton2d &
native()
const {
return sk_; }
84 const ::ik::ecs2d &
state()
const {
return state_; }
88 void ensureStateSize();
89 ::ik::bone2d *boneAt(
int boneId)
const;
90 void requireBone(
int boneId)
const;
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Script-facing 2D skeleton + pose state (ik::skeleton2d + ik::ecs2d). Bone indices are stable after ea...
int getRootId() const
Root bone id (always 0).
::ik::skeleton2d & native()
Skeleton2D & operator=(const Skeleton2D &)=delete
const ::ik::skeleton2d & native() const
~Skeleton2D()=default
Releases skeleton and pose state.
const ::ik::ecs2d & state() const
Skeleton2D(const Skeleton2D &)=delete