载入中...
搜索中...
未找到
ProceduralBoneConfig.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4#include "common/Result.h"
5#include "common/Value.h"
6
7#include <cstdint>
8#include <string>
9#include <string_view>
10#include <vector>
11
12namespace eve::animation {
13class AnimSkeleton;
14class DynamicBoneSolver;
15class FootIKSolver;
16
19 float stiffness=0.5f,damping=0.7f,inertia=0.9f,gravityScale=1.f,radius=0.f;
20};
21
24 std::string rootBone,endBone;
25 float stiffness=0.5f,damping=0.7f,inertia=0.9f,gravityScale=1.f,radius=0.f;
27 bool selfCollision=false;
28 float endLength=0.f,endX=0.f,endY=0.f,endZ=0.f;
29 std::vector<DynamicBoneParticleConfig> particles;
30};
31
34 std::string bone;
35 float startX=0.f,startY=0.f,startZ=0.f,endX=0.f,endY=0.f,endZ=0.f,radius=0.f;
36 bool capsule=false,inside=false,enabled=true;
37};
38
41 std::string hip,knee,foot,toe;
43};
44
54
57 static constexpr std::string_view SchemaId="eve.dynamic-bone";
58 static constexpr std::uint32_t SchemaVersion=1;
59
60 float gravityX=0.f,gravityY=-9.8f,gravityZ=0.f;
61 float externalX=0.f,externalY=0.f,externalZ=0.f;
62 float weight=1.f,updateRate=60.f,teleportThreshold=2.f,objectMoveResponse=1.f,distanceLimit=0.f;
63 std::vector<DynamicBoneChainConfig> chains;
64 std::vector<DynamicBoneColliderConfig> colliders;
67
69 [[nodiscard]] Result<void> validate() const;
71 [[nodiscard]] Result<Value> toValue() const;
73 [[nodiscard]] static Result<DynamicBoneConfig> fromValue(const Value& value);
75 [[nodiscard]] Result<void> apply(AnimSkeleton& skeleton,DynamicBoneSolver& solver) const;
77 [[nodiscard]] Result<void> apply(AnimSkeleton& skeleton,DynamicBoneSolver& dynamicSolver,FootIKSolver& footSolver) const;
78};
79}
double value
#define EVENGINE_API_WORLD
Definition Export.h:109
Move-only, checked operation results for the common layer.
Owning, renderer-independent dynamic values.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
The canonical owning dynamic value used by data-facing protocols.
Definition Value.h:31
std::map< std::string, Value > Object
Definition Value.h:34
3D bone hierarchy + bind-pose local TRS for skeletal animation. Independent of ik::Skeleton3D (FABRIK...
World-space spring-chain solver that writes results as local bone rotations.
Paired-foot IK with contact smoothing and pelvis compensation.
Persisted name-based dynamic-bone chain configuration.
std::vector< DynamicBoneParticleConfig > particles
Persisted fixed or bone-following sphere/capsule configuration.
Versioned, forward-compatible dynamic-bone asset definition.
std::vector< DynamicBoneColliderConfig > colliders
std::vector< DynamicBoneChainConfig > chains
Persisted particle profile for one dynamic-bone chain particle.
Persisted paired-foot IK settings; runtime providers are intentionally excluded.
Persisted name-based leg and optional toe mapping.