载入中...
搜索中...
未找到
AnimSkeleton.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
6
7#include <string>
8#include <vector>
9
10namespace eve::animation {
11
17public:
19 AnimSkeleton() = default;
21 ~AnimSkeleton() = default;
22
23 AnimSkeleton(const AnimSkeleton &) = delete;
25
30 int addBone(const std::string &name, int parentIndex = -1);
31
33 int getBoneCount() const { return static_cast<int>(bones_.size()); }
35 std::string getBoneName(int boneIndex) const;
37 int findBone(const std::string &name) const;
39 int getParent(int boneIndex) const;
40
42 void setBindPosition(int boneIndex, float x, float y, float z);
44 void setBindRotation(int boneIndex, float x, float y, float z, float w);
46 void setBindScale(int boneIndex, float x, float y, float z);
47
49 float getBindPositionX(int boneIndex) const;
51 float getBindPositionY(int boneIndex) const;
53 float getBindPositionZ(int boneIndex) const;
55 float getBindRotationX(int boneIndex) const;
57 float getBindRotationY(int boneIndex) const;
59 float getBindRotationZ(int boneIndex) const;
61 float getBindRotationW(int boneIndex) const;
63 float getBindScaleX(int boneIndex) const;
65 float getBindScaleY(int boneIndex) const;
67 float getBindScaleZ(int boneIndex) const;
68
73 void setBoneLodLimit(int boneIndex, int highestLod);
75 int getBoneLodLimit(int boneIndex) const;
76
78 const TransformTRS &bindLocal(int boneIndex) const;
79
81 void applyBindPose(class AnimPose *pose) const;
82
83private:
84 struct Bone {
85 std::string name;
86 int parent = -1;
87 TransformTRS bind;
88 int lodLimit = 0x7fffffff;
89 };
90
91 void requireBone(int boneIndex) const;
92 std::vector<Bone> bones_;
93};
94
95} // namespace eve::animation
float w
Definition AnimClip.cpp:738
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
float z
Definition AnimClip.cpp:738
eve::EntitySpatialPose pose
#define EVENGINE_API_WORLD
Definition Export.h:109
std::int32_t parent
std::string name
Evaluated local (and optional world) pose for an AnimSkeleton. Script type: AnimPose.
Definition AnimPose.h:17
3D bone hierarchy + bind-pose local TRS for skeletal animation. Independent of ik::Skeleton3D (FABRIK...
int getBoneCount() const
Returns the bone count.
~AnimSkeleton()=default
Anim skeleton.
AnimSkeleton(const AnimSkeleton &)=delete
AnimSkeleton & operator=(const AnimSkeleton &)=delete
AnimSkeleton()=default
Anim skeleton.
Local TRS used by skeletal animation (quaternion xyzw).
Definition AnimMath.h:9