Script-facing 2D skeleton + pose state. Bone indices are stable after each createBone / topological refresh. Root bone is always id 0. 更多...
#include <Skeleton2D.h>
类 | |
| struct | Impl |
Public 成员函数 | |
| Skeleton2D () | |
| Creates an empty 2D skeleton with a root bone. | |
| ~Skeleton2D () | |
| Releases skeleton and pose state. | |
| Skeleton2D (const Skeleton2D &)=delete | |
| Skeleton2D & | operator= (const Skeleton2D &)=delete |
| int | createBone (int parentId, float length=1.f) |
| Create a child bone under parentId; returns new bone id. | |
| int | getBoneCount () const |
| Number of bones currently in the skeleton. | |
| int | getRootId () const |
| Root bone id (always 0). | |
| int | getParent (int boneId) const |
| Parent bone id, or -1 for the root. | |
| int | getChildCount (int boneId) const |
| Number of direct children of boneId. | |
| int | getChild (int boneId, int childIndex) const |
| Child bone id at childIndex under boneId. | |
| float | getLength (int boneId) const |
| Rest length of the bone. | |
| void | setLength (int boneId, float length) |
| Sets the rest length of the bone. | |
| void | setPosition (int boneId, float x, float y) |
| Sets the world-space bone position. | |
| float | getX (int boneId) const |
| World-space X of the bone (or component). | |
| float | getY (int boneId) const |
| World-space Y of the bone (or component). | |
| void | setOrientation (int boneId, float x, float y) |
| Sets the bone forward orientation vector. | |
| float | getOrientationX (int boneId) const |
| Orientation vector X. | |
| float | getOrientationY (int boneId) const |
| Orientation vector Y. | |
| void | setRotation (int boneId, float angle) |
| Local hinge angle (radians) relative to parent forward. | |
| float | getRotation (int boneId) const |
| Local hinge angle in radians. | |
| void | setConstraints (int boneId, float minAngle, float maxAngle) |
| Joint limits for the single 2D hinge DOF. | |
| void | clearConstraints (int boneId) |
| Removes joint limits from the bone. | |
| bool | hasConstraints (int boneId) const |
| True if the bone has joint limits. | |
| void | initStraightPose (float rootX=0.f, float rootY=0.f) |
| Initializes a straight chain pose from the root. | |
| void | bind () |
| Binds the current pose as the rest pose. | |
| void | forwardKinematics () |
| Updates world positions from local rotations. | |
| void | updateRotations () |
| Derives local rotations from world positions. | |
| float | totalLengthTo (int boneId) const |
| Sum of bone lengths from root to boneId inclusive. | |
友元 | |
| class | Solver2D |
详细描述
Script-facing 2D skeleton + pose state. Bone indices are stable after each createBone / topological refresh. Root bone is always id 0.
- 注解
- Public headers intentionally hide the underlying ik.hpp types (Pimpl).
在文件 Skeleton2D.h 第 16 行定义.
构造及析构函数说明
◆ Skeleton2D() [1/2]
| eve::ik::Skeleton2D::Skeleton2D | ( | ) |
Creates an empty 2D skeleton with a root bone.
在文件 Skeleton2D.cpp 第 11 行定义.
◆ ~Skeleton2D()
|
default |
Releases skeleton and pose state.
◆ Skeleton2D() [2/2]
|
delete |
成员函数说明
◆ bind()
| void eve::ik::Skeleton2D::bind | ( | ) |
Binds the current pose as the rest pose.
在文件 Skeleton2D.cpp 第 151 行定义.
◆ clearConstraints()
| void eve::ik::Skeleton2D::clearConstraints | ( | int | boneId | ) |
Removes joint limits from the bone.
在文件 Skeleton2D.cpp 第 135 行定义.
◆ createBone()
| int eve::ik::Skeleton2D::createBone | ( | int | parentId, |
| float | length = 1.f |
||
| ) |
Create a child bone under parentId; returns new bone id.
在文件 Skeleton2D.cpp 第 24 行定义.
◆ forwardKinematics()
| void eve::ik::Skeleton2D::forwardKinematics | ( | ) |
Updates world positions from local rotations.
在文件 Skeleton2D.cpp 第 157 行定义.
◆ getBoneCount()
| int eve::ik::Skeleton2D::getBoneCount | ( | ) | const |
Number of bones currently in the skeleton.
在文件 Skeleton2D.cpp 第 37 行定义.
被这些函数引用 eve::particles::ParticleEmitter::attachToSkeleton2D().
◆ getChild()
| int eve::ik::Skeleton2D::getChild | ( | int | boneId, |
| int | childIndex | ||
| ) | const |
◆ getChildCount()
| int eve::ik::Skeleton2D::getChildCount | ( | int | boneId | ) | const |
Number of direct children of boneId.
在文件 Skeleton2D.cpp 第 49 行定义.
◆ getLength()
| float eve::ik::Skeleton2D::getLength | ( | int | boneId | ) | const |
Rest length of the bone.
在文件 Skeleton2D.cpp 第 63 行定义.
◆ getOrientationX()
| float eve::ik::Skeleton2D::getOrientationX | ( | int | boneId | ) | const |
Orientation vector X.
在文件 Skeleton2D.cpp 第 103 行定义.
◆ getOrientationY()
| float eve::ik::Skeleton2D::getOrientationY | ( | int | boneId | ) | const |
Orientation vector Y.
在文件 Skeleton2D.cpp 第 109 行定义.
◆ getParent()
| int eve::ik::Skeleton2D::getParent | ( | int | boneId | ) | const |
◆ getRootId()
|
inline |
Root bone id (always 0).
在文件 Skeleton2D.h 第 32 行定义.
◆ getRotation()
| float eve::ik::Skeleton2D::getRotation | ( | int | boneId | ) | const |
Local hinge angle in radians.
在文件 Skeleton2D.cpp 第 121 行定义.
◆ getX()
| float eve::ik::Skeleton2D::getX | ( | int | boneId | ) | const |
World-space X of the bone (or component).
在文件 Skeleton2D.cpp 第 85 行定义.
◆ getY()
| float eve::ik::Skeleton2D::getY | ( | int | boneId | ) | const |
World-space Y of the bone (or component).
在文件 Skeleton2D.cpp 第 91 行定义.
◆ hasConstraints()
| bool eve::ik::Skeleton2D::hasConstraints | ( | int | boneId | ) | const |
True if the bone has joint limits.
在文件 Skeleton2D.cpp 第 140 行定义.
◆ initStraightPose()
Initializes a straight chain pose from the root.
在文件 Skeleton2D.cpp 第 145 行定义.
◆ operator=()
|
delete |
◆ setConstraints()
| void eve::ik::Skeleton2D::setConstraints | ( | int | boneId, |
| float | minAngle, | ||
| float | maxAngle | ||
| ) |
Joint limits for the single 2D hinge DOF.
在文件 Skeleton2D.cpp 第 127 行定义.
◆ setLength()
| void eve::ik::Skeleton2D::setLength | ( | int | boneId, |
| float | length | ||
| ) |
◆ setOrientation()
| void eve::ik::Skeleton2D::setOrientation | ( | int | boneId, |
| float | x, | ||
| float | y | ||
| ) |
◆ setPosition()
| void eve::ik::Skeleton2D::setPosition | ( | int | boneId, |
| float | x, | ||
| float | y | ||
| ) |
◆ setRotation()
| void eve::ik::Skeleton2D::setRotation | ( | int | boneId, |
| float | angle | ||
| ) |
◆ totalLengthTo()
| float eve::ik::Skeleton2D::totalLengthTo | ( | int | boneId | ) | const |
Sum of bone lengths from root to boneId inclusive.
在文件 Skeleton2D.cpp 第 169 行定义.
◆ updateRotations()
| void eve::ik::Skeleton2D::updateRotations | ( | ) |
Derives local rotations from world positions.
在文件 Skeleton2D.cpp 第 163 行定义.
友元及相关函数文档
◆ Solver2D
|
friend |
在文件 Skeleton2D.h 第 84 行定义.
该类的文档由以下文件生成:
- src/modules/ik/Skeleton2D.h
- src/modules/ik/Skeleton2D.cpp