vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
ragdoll_build.h
1#pragma once
2
3#include "ecs/entity.h"
4#include "resource/asset/skeleton_asset.h"
5
6namespace Vkm::Engine {
7
8class Scene;
9
17 float thickness = 0.22f;
18
22 float minBoneLength = 0.06f;
23
24 float mass = 70.0f;
25 float stiffness = 1.0f;
26
33 float muscle = 0.4f;
34
42 int boneLayer = 1 << 1;
43};
44
59uint32_t buildRagdoll(
60 Scene& scene,
61 EntityId rigEntity,
62 const SkeletonAsset& rig,
63 const RagdollSettings& settings = {}
64);
65
72void clearRagdoll(Scene& scene, EntityId rigEntity);
73
74} // namespace Vkm::Engine
Central registry managing entities and an open set of component types.
Definition scene.h:29
Names one entity of one Scene, for as long as that slot holds it.
Definition entity.h:23
How a ragdoll is proportioned and weighted.
Definition ragdoll_build.h:13
float stiffness
Passed to every joint the build makes.
Definition ragdoll_build.h:25
int boneLayer
Collision layer the bones are put on, as a single bit.
Definition ragdoll_build.h:42
float minBoneLength
Shortest bone that gets a body of its own, in metres; a shorter one follows its parent.
Definition ragdoll_build.h:22
float mass
Total mass, shared out by limb volume.
Definition ragdoll_build.h:24
float muscle
How much of the body's shape it keeps once limp, 0 to 1.
Definition ragdoll_build.h:33
float thickness
Bone radius as a fraction of its length; a rig carries no thickness of its own.
Definition ragdoll_build.h:17
A rig: a flat, parent-before-child bone array plus its bind pose.
Definition skeleton_asset.h:33