载入中...
搜索中...
未找到
IK.cpp
浏览该文件的文档.
Inverse Kinematics module — thin script facade over sunxfancy/ik.hpp (FABRIK). Script: ik <- eve....
Definition IK.h:20
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. Bone indices are stable after each createBone / topological r...
Definition Skeleton2D.h:16
void setOrientation(int boneId, float x, float y)
Sets the bone forward orientation vector.
Definition Skeleton2D.cpp:97
void setRotation(int boneId, float angle)
Local hinge angle (radians) relative to parent forward.
Definition Skeleton2D.cpp:115
float totalLengthTo(int boneId) const
Sum of bone lengths from root to boneId inclusive.
Definition Skeleton2D.cpp:169
bool hasConstraints(int boneId) const
True if the bone has joint limits.
Definition Skeleton2D.cpp:140
void initStraightPose(float rootX=0.f, float rootY=0.f)
Initializes a straight chain pose from the root.
Definition Skeleton2D.cpp:145
void setConstraints(int boneId, float minAngle, float maxAngle)
Joint limits for the single 2D hinge DOF.
Definition Skeleton2D.cpp:127
void setLength(int boneId, float length)
Sets the rest length of the bone.
Definition Skeleton2D.cpp:68
int createBone(int parentId, float length=1.f)
Create a child bone under parentId; returns new bone id.
Definition Skeleton2D.cpp:24
void setPosition(int boneId, float x, float y)
Sets the world-space bone position.
Definition Skeleton2D.cpp:79
int getChild(int boneId, int childIndex) const
Child bone id at childIndex under boneId.
Definition Skeleton2D.cpp:54
Script-facing 3D skeleton + pose state. Local angles are yaw/pitch in the parent bone frame.
Definition Skeleton3D.h:15
void setPosition(int boneId, float x, float y, float z)
Sets the world-space bone position.
Definition Skeleton2D.cpp:246
void setConstraints(int boneId, float minYaw, float minPitch, float maxYaw, float maxPitch)
Sets joint angle limits for the bone.
Definition Skeleton2D.cpp:312
void setLength(int boneId, float length)
Sets the rest length of the bone.
Definition Skeleton2D.cpp:235
int getChildCount(int boneId) const
Number of direct children of boneId.
Definition Skeleton2D.cpp:216
int createBone(int parentId, float length=1.f)
Create a child bone under parentId; returns new bone id.
Definition Skeleton2D.cpp:191
void setRotation(int boneId, float yaw, float pitch)
Sets local hinge/yaw-pitch rotation (radians).
Definition Skeleton2D.cpp:294
void setOrientation(int boneId, float x, float y, float z)
Sets the bone forward orientation vector.
Definition Skeleton2D.cpp:270
void initStraightPose(float rootX=0.f, float rootY=0.f, float rootZ=0.f)
Initializes a straight chain pose from the root.
Definition Skeleton2D.cpp:330
float totalLengthTo(int boneId) const
Sum of bone lengths from root to boneId inclusive.
Definition Skeleton2D.cpp:354
bool hasConstraints(int boneId) const
True if the bone has joint limits.
Definition Skeleton2D.cpp:325
int getChild(int boneId, int childIndex) const
Child bone id at childIndex under boneId.
Definition Skeleton2D.cpp:221
void step(Skeleton2D *skeleton, float dt=1.f)
Runs a time-scaled FABRIK step (dt scales iteration effort).
Definition Solver2D.cpp:89
void setKeepTrace(bool keep)
When true, records intermediate solve samples.
Definition Solver2D.cpp:26
void setInfluence(float influence)
Overall pose blend: 0 = keep the input pose, 1 = full solve (default).
Definition Solver2D.cpp:60
void addTarget(int boneId, float x, float y, float weight=1.f)
Adds an end-effector target for a bone.
Definition Solver2D.cpp:71
bool solve(Skeleton2D *skeleton)
Returns true if every target is within tolerance.
Definition Solver2D.cpp:80
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:126
void stepChain(Skeleton2D *skeleton, int rootBoneId, int tipBoneId, float dt=1.f)
Time-scaled chain-scoped FABRIK step.
Definition Solver2D.cpp:134
float getInfluence() const
Pose blend weight (0 = keep input, 1 = full solve).
Definition Solver2D.cpp:67
void addTarget(int boneId, float x, float y, float z, float weight=1.f)
Adds an end-effector target for a bone.
Definition Solver2D.cpp:206
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 Solver2D.cpp:285
bool solve(Skeleton3D *skeleton)
Runs FABRIK until tolerance or max iterations.
Definition Solver2D.cpp:215
void setInfluence(float influence)
Overall pose blend: 0 = keep the input pose, 1 = full solve (default).
Definition Solver2D.cpp:195
void stepChain(Skeleton3D *skeleton, int rootBoneId, int tipBoneId, float dt=1.f)
Time-scaled chain-scoped FABRIK step.
Definition Solver2D.cpp:269
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 Solver2D.cpp:261
float getInfluence() const
Pose blend weight (0 = keep input, 1 = full solve).
Definition Solver2D.cpp:202
void setMaxIterations(int iterations)
Maximum FABRIK iterations per solve.
Definition Solver2D.cpp:168
void step(Skeleton3D *skeleton, float dt=1.f)
Runs a time-scaled FABRIK step (dt scales iteration effort).
Definition Solver2D.cpp:224
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 Solver2D.cpp:277
void setKeepTrace(bool keep)
When true, records intermediate solve samples.
Definition Solver2D.cpp:161
Definition SkeletonImpl.h:13