载入中...
搜索中...
未找到
IK.cpp
浏览该文件的文档.
Inverse Kinematics module — wraps header-only sunxfancy/ik.hpp (FABRIK). Script: ik <- eve....
Definition IK.h:19
Skeleton3D * newSkeleton3D()
Creates an empty 3D skeleton. @ownership Caller deletes.
Definition IK.cpp:14
Skeleton2D * newSkeleton2D()
Creates an empty 2D skeleton. @ownership Caller deletes.
Definition IK.cpp:13
Script-facing 2D skeleton + pose state (ik::skeleton2d + ik::ecs2d). Bone indices are stable after ea...
Definition Skeleton2D.h:14
void setOrientation(int boneId, float x, float y)
Sets the bone forward orientation vector.
Definition Skeleton2D.cpp:116
void setRotation(int boneId, float angle)
Local hinge angle (radians) relative to parent forward.
Definition Skeleton2D.cpp:134
float totalLengthTo(int boneId) const
Sum of bone lengths from root to boneId inclusive.
Definition Skeleton2D.cpp:189
bool hasConstraints(int boneId) const
True if the bone has joint limits.
Definition Skeleton2D.cpp:160
void initStraightPose(float rootX=0.f, float rootY=0.f)
Initializes a straight chain pose from the root.
Definition Skeleton2D.cpp:165
void setConstraints(int boneId, float minAngle, float maxAngle)
Joint limits for the single 2D hinge DOF.
Definition Skeleton2D.cpp:146
void setLength(int boneId, float length)
Sets the rest length of the bone.
Definition Skeleton2D.cpp:87
int createBone(int parentId, float length=1.f)
Create a child bone under parentId; returns new bone id.
Definition Skeleton2D.cpp:43
void setPosition(int boneId, float x, float y)
Sets the world-space bone position.
Definition Skeleton2D.cpp:98
int getChild(int boneId, int childIndex) const
Child bone id at childIndex under boneId.
Definition Skeleton2D.cpp:73
Script-facing 3D skeleton + pose state (ik::skeleton3d + ik::ecs3d). Local angles are yaw/pitch in th...
Definition Skeleton3D.h:13
void setPosition(int boneId, float x, float y, float z)
Sets the world-space bone position.
Definition Skeleton3D.cpp:98
void setConstraints(int boneId, float minYaw, float minPitch, float maxYaw, float maxPitch)
Sets joint angle limits for the bone.
Definition Skeleton3D.cpp:164
void setLength(int boneId, float length)
Sets the rest length of the bone.
Definition Skeleton3D.cpp:87
int createBone(int parentId, float length=1.f)
Create a child bone under parentId; returns new bone id.
Definition Skeleton3D.cpp:43
void setRotation(int boneId, float yaw, float pitch)
Sets local hinge/yaw-pitch rotation (radians).
Definition Skeleton3D.cpp:146
void setOrientation(int boneId, float x, float y, float z)
Sets the bone forward orientation vector.
Definition Skeleton3D.cpp:122
void initStraightPose(float rootX=0.f, float rootY=0.f, float rootZ=0.f)
Initializes a straight chain pose from the root.
Definition Skeleton3D.cpp:184
float totalLengthTo(int boneId) const
Sum of bone lengths from root to boneId inclusive.
Definition Skeleton3D.cpp:208
bool hasConstraints(int boneId) const
True if the bone has joint limits.
Definition Skeleton3D.cpp:179
int getChild(int boneId, int childIndex) const
Child bone id at childIndex under boneId.
Definition Skeleton3D.cpp:73
void step(Skeleton2D *skeleton, float dt=1.f)
Runs a time-scaled FABRIK step (dt scales iteration effort).
Definition Solver2D.cpp:85
void setInfluence(float influence)
Overall pose blend: 0 = keep the input pose, 1 = full solve (default).
Definition Solver2D.cpp:43
void addTarget(int boneId, float x, float y, float weight=1.f)
Adds an end-effector target for a bone.
Definition Solver2D.cpp:54
bool solve(Skeleton2D *skeleton)
Returns true if every target is within tolerance.
Definition Solver2D.cpp:65
bool solveChain(Skeleton2D *skeleton, int rootBoneId, int tipBoneId)
FABRIK solve restricted to the bone chain rootBoneId..tipBoneId. The chain root stays pinned and bone...
Definition Solver2D.cpp:104
void stepChain(Skeleton2D *skeleton, int rootBoneId, int tipBoneId, float dt=1.f)
Time-scaled chain-scoped FABRIK step.
Definition Solver2D.cpp:113
float getInfluence() const
Pose blend weight (0 = keep input, 1 = full solve).
Definition Solver2D.cpp:50
void addTarget(int boneId, float x, float y, float z, float weight=1.f)
Adds an end-effector target for a bone.
Definition Solver3D.cpp:54
void setTipRotation(int boneId, float yaw, float pitch, float weight)
Tip orientation override: after solving, blends the tip bone's local yaw/pitch toward the given angle...
Definition Solver3D.cpp:186
bool solve(Skeleton3D *skeleton)
Runs FABRIK until tolerance or max iterations.
Definition Solver3D.cpp:65
void setInfluence(float influence)
Overall pose blend: 0 = keep the input pose, 1 = full solve (default).
Definition Solver3D.cpp:43
void stepChain(Skeleton3D *skeleton, int rootBoneId, int tipBoneId, float dt=1.f)
Time-scaled chain-scoped FABRIK step.
Definition Solver3D.cpp:118
bool solveChain(Skeleton3D *skeleton, int rootBoneId, int tipBoneId)
FABRIK solve restricted to the bone chain rootBoneId..tipBoneId. The chain root stays pinned and bone...
Definition Solver3D.cpp:106
float getInfluence() const
Pose blend weight (0 = keep input, 1 = full solve).
Definition Solver3D.cpp:50
void step(Skeleton3D *skeleton, float dt=1.f)
Runs a time-scaled FABRIK step (dt scales iteration effort).
Definition Solver3D.cpp:86
void setPole(float x, float y, float z, float weight)
Pole vector (magnet / hint): pulls the middle joints of a chain toward a point so the limb bends in t...
Definition Solver3D.cpp:171
Definition ChainSolver.h:10