vkmEngine
1.0.0
A C++ game engine ·
vkmengine.com
Loading...
Searching...
No Matches
ragdoll_system.h
1
#pragma once
2
3
#include <cstdint>
4
#include <vector>
5
6
#include "core/system.h"
7
#include "debug/fault_latch.h"
8
#include "ecs/entity.h"
9
#include "ecs/scene_observer.h"
10
11
namespace
Vkm::Engine {
12
13
class
Scene
;
14
26
EntityId
ragdollOwnerOf(
const
Scene
& scene,
EntityId
body, int32_t* outBone =
nullptr
);
27
38
class
RagdollSystem :
public
System,
public
ISceneObserver {
39
public
:
40
RagdollSystem() =
default
;
41
~RagdollSystem()
override
=
default
;
42
43
RagdollSystem(
const
RagdollSystem& other) =
delete
;
44
RagdollSystem& operator=(
const
RagdollSystem& other) =
delete
;
45
46
RagdollSystem(RagdollSystem && other) =
delete
;
47
RagdollSystem& operator=(RagdollSystem && other) =
delete
;
48
49
public
:
50
void
init
(
FrameContext
& ctx)
override
;
51
void
fixedUpdate
(
FrameContext
& ctx)
override
;
52
54
void
shutdown
()
override
;
55
64
void
onEntityDestroyed
(
EntityId
id
)
override
;
65
66
private
:
67
Scene
* m_scene =
nullptr
;
68
FaultLatch
m_scaled;
69
};
70
81
bool
isPosedByAnimation(
const
Scene
& scene,
EntityId
entity);
82
91
void
markPosedByAnimation(
const
Scene
& scene, std::vector<bool>& bySlot);
92
93
}
// namespace Vkm::Engine
Vkm::Engine::FaultLatch
Names a recurring fault once per gap rather than once a frame.
Definition
fault_latch.h:11
Vkm::Engine::RagdollSystem::init
void init(FrameContext &ctx) override
Called once after all systems are registered, before the first update.
Vkm::Engine::RagdollSystem::fixedUpdate
void fixedUpdate(FrameContext &ctx) override
Execute this system at the fixed simulation rate.
Vkm::Engine::RagdollSystem::onEntityDestroyed
void onEntityDestroyed(EntityId id) override
Destroy a ragdoll's bones when the thing they belong to goes.
Vkm::Engine::RagdollSystem::shutdown
void shutdown() override
Drops the observer registration, so nothing calls a dead system.
Vkm::Engine::Scene
Central registry managing entities and an open set of component types.
Definition
scene.h:29
Vkm::Engine::EntityId
Names one entity of one Scene, for as long as that slot holds it.
Definition
entity.h:23
Vkm::Engine::FrameContext
Per-frame state bundle passed to every system.
Definition
system.h:55
system
physics
ragdoll_system.h
Generated by
1.14.0