vkmEngine 1.0.15
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
ragdoll_build.h
1#pragma once
2
3#include "ecs/entity.h"
4#include "ecs/component/physics/ragdoll.h"
5#include "resource/asset/skeleton_asset.h"
6
7namespace Vkm::Engine {
8
9class Scene;
10
18 float thickness = 0.22f;
19
23 float minBoneLength = 0.06f;
24
25 float mass = 70.0f;
26 float stiffness = 1.0f;
27
34 float muscle = 0.4f;
35
44};
45
60uint32_t buildRagdoll(
61 Scene& scene,
62 EntityId rigEntity,
63 const SkeletonAsset& rig,
64 const RagdollSettings& settings = {}
65);
66
73void clearRagdoll(Scene& scene, EntityId rigEntity);
74
75} // 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:14
float stiffness
Passed to every joint the build makes.
Definition ragdoll_build.h:26
int boneLayer
Collision layer the bones are put on, as a single bit.
Definition ragdoll_build.h:43
float minBoneLength
Shortest bone that gets a body of its own, in metres; a shorter one follows its parent.
Definition ragdoll_build.h:23
float mass
Total mass, shared out by limb volume.
Definition ragdoll_build.h:25
float muscle
How much of the body's shape it keeps once limp, 0 to 1.
Definition ragdoll_build.h:34
float thickness
Bone radius as a fraction of its length; a rig carries no thickness of its own.
Definition ragdoll_build.h:18
static constexpr int DEFAULT_BONE_LAYER
The layer bit the bones go on unless the build names another (RagdollSettings::boneLayer).
Definition ragdoll.h:51
A rig: a flat, parent-before-child bone array plus its bind pose.
Definition skeleton_asset.h:33