载入中...
搜索中...
未找到
Skeleton3D.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include <memory>
5
6namespace eve::ik {
7
8class Solver3D;
9
16public:
18 Skeleton3D();
21
22 Skeleton3D(const Skeleton3D &) = delete;
23 Skeleton3D &operator=(const Skeleton3D &) = delete;
24
26 int createBone(int parentId, float length = 1.f);
27
29 int getBoneCount() const;
31 int getRootId() const { return 0; }
33 int getParent(int boneId) const;
35 int getChildCount(int boneId) const;
37 int getChild(int boneId, int childIndex) const;
38
40 float getLength(int boneId) const;
42 void setLength(int boneId, float length);
43
45 void setPosition(int boneId, float x, float y, float z);
47 float getX(int boneId) const;
49 float getY(int boneId) const;
51 float getZ(int boneId) const;
52
54 void setOrientation(int boneId, float x, float y, float z);
56 float getOrientationX(int boneId) const;
58 float getOrientationY(int boneId) const;
60 float getOrientationZ(int boneId) const;
61
63 void setRotation(int boneId, float yaw, float pitch);
65 float getRotationYaw(int boneId) const;
67 float getRotationPitch(int boneId) const;
68
70 void setConstraints(int boneId, float minYaw, float minPitch, float maxYaw, float maxPitch);
72 void clearConstraints(int boneId);
74 bool hasConstraints(int boneId) const;
75
77 void initStraightPose(float rootX = 0.f, float rootY = 0.f, float rootZ = 0.f);
79 void bind();
81 void forwardKinematics();
83 void updateRotations();
84
86 float totalLengthTo(int boneId) const;
87
88private:
89 friend class Solver3D;
90 struct Impl;
91 std::unique_ptr<Impl> impl_;
92
93 void requireBone(int boneId) const;
94};
95
96} // namespace eve::ik
double z
double y
double x
float yaw
Definition BushMesh.cpp:37
std::uint64_t parentId
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
float length
Script-facing 3D skeleton + pose state. Local angles are yaw/pitch in the parent bone frame.
Definition Skeleton3D.h:15
~Skeleton3D()
Releases skeleton and pose state.
Skeleton3D & operator=(const Skeleton3D &)=delete
Skeleton3D(const Skeleton3D &)=delete
int getRootId() const
Root bone id (always 0).
Definition Skeleton3D.h:31
FABRIK solver for Skeleton3D. Script type: Solver3D.
Definition Solver3D.h:13