载入中...
搜索中...
未找到
Solver3D.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include <memory>
5
6namespace eve::ik {
7
8class Skeleton3D;
9
14public:
16 Solver3D();
19
20 Solver3D(const Solver3D &) = delete;
21 Solver3D &operator=(const Solver3D &) = delete;
22
24 void setKeepTrace(bool keep);
26 bool getKeepTrace() const;
27
29 void setMaxIterations(int iterations);
31 int getMaxIterations() const;
33 void setTolerance(float tol);
35 float getTolerance() const;
37 void setForce(float force);
39 float getForce() const;
40
42 void setInfluence(float influence);
44 float getInfluence() const;
45
47 void clearTargets();
49 void addTarget(int boneId, float x, float y, float z, float weight = 1.f);
51 int getTargetCount() const;
52
54 bool solve(Skeleton3D *skeleton);
56 void step(Skeleton3D *skeleton, float dt = 1.f);
57
63 bool solveChain(Skeleton3D *skeleton, int rootBoneId, int tipBoneId);
65 void stepChain(Skeleton3D *skeleton, int rootBoneId, int tipBoneId, float dt = 1.f);
66
72 void setPole(float x, float y, float z, float weight);
74 void clearPole();
76 bool hasPole() const;
78 float getPoleWeight() const;
79
84 void setTipRotation(int boneId, float yaw, float pitch, float weight);
86 void clearTipRotation();
88 float getTipRotationWeight() const;
89
91 int getTraceSize() const;
93 void clearTrace();
94
95private:
96 struct Impl;
97 std::unique_ptr<Impl> impl_;
98
99 void requireChain(Skeleton3D *skeleton, int rootBoneId, int tipBoneId) const;
100};
101
102} // namespace eve::ik
double z
double y
double x
float yaw
Definition BushMesh.cpp:37
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
ForceVector force
double dt
int iterations
Definition TreeMesh.cpp:448
float step
Definition TreeMesh.cpp:451
double weight
Script-facing 3D skeleton + pose state. Local angles are yaw/pitch in the parent bone frame.
Definition Skeleton3D.h:15
FABRIK solver for Skeleton3D. Script type: Solver3D.
Definition Solver3D.h:13
Solver3D(const Solver3D &)=delete
Solver3D & operator=(const Solver3D &)=delete
~Solver3D()
Releases solver state.