载入中...
搜索中...
未找到
HairDynamicBones.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include "common/Result.h"
5
6#include <string>
7#include <vector>
8
9namespace eve::animation {
10
11class DynamicBoneSolver;
12
20namespace hair {
21
23struct ChainDesc {
24 std::string rootBone;
25 std::string tipBone;
26 float stiffness = 0.12f;
27 float damping = 0.18f;
28 float inertia = 0.8f;
29 float gravityScale = 1.f;
30 float radius = 0.02f;
31 int iterations = 4;
33 float endLength = 0.08f;
34 bool selfCollision = true;
35};
36
42
48 const std::vector<ChainDesc> &chains, bool clearFirst = true);
49
54[[nodiscard]] EVENGINE_API_WORLD Result<int> addHeadCollider(DynamicBoneSolver &solver, const std::string &boneName,
55 float radius = 0.12f, float offsetX = 0.f,
56 float offsetY = 0.f, float offsetZ = 0.f);
57
58} // namespace hair
59
60} // namespace eve::animation
scene::NodeDesc desc
#define EVENGINE_API_WORLD
Definition Export.h:109
float radius
bool hair
Move-only, checked operation results for the common layer.
float offsetX
float offsetY
Move-only operation result carrying either a value or Status.
Definition Result.h:155
World-space spring-chain solver that writes results as local bone rotations.
Result< int > addHeadCollider(DynamicBoneSolver &solver, const std::string &boneName, float radius, float offsetX, float offsetY, float offsetZ)
Attach a bone-following sphere collider (typically the head) for hair chains.
Result< void > setupChains(DynamicBoneSolver &solver, const std::vector< ChainDesc > &chains, bool clearFirst)
Replace or append hair chains.
Result< int > addChain(DynamicBoneSolver &solver, const ChainDesc &desc)
Add one hair/tail chain by bone name.
One named spring chain with game-friendly hair defaults.
float endLength
Virtual tip length past the last bone; <=0 disables.