载入中...
搜索中...
未找到
AnimSkeleton.h
浏览该文件的文档.
1#pragma once
2
4
5#include <string>
6#include <vector>
7
8namespace eve::animation {
9
15public:
16 AnimSkeleton() = default;
17 ~AnimSkeleton() = default;
18
19 AnimSkeleton(const AnimSkeleton &) = delete;
21
26 int addBone(const std::string &name, int parentIndex = -1);
27
28 int getBoneCount() const { return static_cast<int>(bones_.size()); }
29 std::string getBoneName(int boneIndex) const;
30 int findBone(const std::string &name) const;
31 int getParent(int boneIndex) const;
32
33 void setBindPosition(int boneIndex, float x, float y, float z);
34 void setBindRotation(int boneIndex, float x, float y, float z, float w);
35 void setBindScale(int boneIndex, float x, float y, float z);
36
37 float getBindPositionX(int boneIndex) const;
38 float getBindPositionY(int boneIndex) const;
39 float getBindPositionZ(int boneIndex) const;
40 float getBindRotationX(int boneIndex) const;
41 float getBindRotationY(int boneIndex) const;
42 float getBindRotationZ(int boneIndex) const;
43 float getBindRotationW(int boneIndex) const;
44 float getBindScaleX(int boneIndex) const;
45 float getBindScaleY(int boneIndex) const;
46 float getBindScaleZ(int boneIndex) const;
47
48 const TransformTRS &bindLocal(int boneIndex) const;
49
51 void applyBindPose(class AnimPose *pose) const;
52
53private:
54 struct Bone {
55 std::string name;
56 int parent = -1;
57 TransformTRS bind;
58 };
59
60 void requireBone(int boneIndex) const;
61 std::vector<Bone> bones_;
62};
63
64} // namespace eve::animation
int y
Definition Grass.cpp:135
int z
Definition Grass.cpp:135
int x
Definition Grass.cpp:135
int w
const char * name
Definition RockMesh.cpp:21
int parent
Definition TreeMesh.cpp:175
Evaluated local (and optional world) pose for an AnimSkeleton. Script type: AnimPose.
Definition AnimPose.h:15
3D bone hierarchy + bind-pose local TRS for skeletal animation. Independent of ik::Skeleton3D (FABRIK...
float getBindPositionY(int boneIndex) const
float getBindScaleX(int boneIndex) const
int getParent(int boneIndex) const
void setBindPosition(int boneIndex, float x, float y, float z)
float getBindPositionZ(int boneIndex) const
AnimSkeleton(const AnimSkeleton &)=delete
float getBindRotationW(int boneIndex) const
float getBindScaleY(int boneIndex) const
float getBindRotationY(int boneIndex) const
AnimSkeleton & operator=(const AnimSkeleton &)=delete
float getBindScaleZ(int boneIndex) const
float getBindPositionX(int boneIndex) const
const TransformTRS & bindLocal(int boneIndex) const
float getBindRotationZ(int boneIndex) const
float getBindRotationX(int boneIndex) const
std::string getBoneName(int boneIndex) const
int findBone(const std::string &name) const
void setBindScale(int boneIndex, float x, float y, float z)
void setBindRotation(int boneIndex, float x, float y, float z, float w)
void applyBindPose(class AnimPose *pose) const
Fill pose locals with bind pose.
int addBone(const std::string &name, int parentIndex=-1)
Append a bone. parentIndex = -1 for root.
Local TRS used by skeletal animation (quaternion xyzw).
Definition AnimMath.h:9