Skip to main content

CollisionStateClearSystem.ixx File

System for resetting collision state components each frame. More...

Included Headers

#include <algorithm> #include <cassert> #include <cmath> #include <format> #include <helios/helios_config.h> #include <unordered_set> #include <vector> #include <helios.engine.common.tags.SystemRole> #include <helios.engine.mechanics.lifecycle.components.Active> #include <helios.engine.runtime.spawn.commands.DespawnCommand> #include <helios.engine.modules.physics.collision.components.CollisionStateComponent> #include <helios.engine.modules.physics.collision.types.CollisionBehavior> #include <helios.engine.runtime.world.UpdateContext> #include <helios.engine.runtime.world.GameWorld>

Namespaces Index

namespacehelios
namespaceengine

Main engine module aggregating core infrastructure and game systems. More...

namespacemodules

Domain-specific components and systems. More...

namespacephysics

Physics simulation and collision detection subsystem for the game engine. More...

namespacecollision
namespacesystems

Collision detection and response systems. More...

Classes Index

classCollisionStateClearSystem

System that clears collision state components at the end of each frame. More...

Description

System for resetting collision state components each frame.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file CollisionStateClearSystem.ixx
3 * @brief System for resetting collision state components each frame.
4 */
5module;
6
7#include <algorithm>
8#include <cassert>
9#include <cmath>
10#include <format>
11#include <helios/helios_config.h>
12#include <unordered_set>
13#include <vector>
14
15
16export module helios.engine.modules.physics.collision.systems.CollisionStateClearSystem;
17
18import helios.engine.runtime.world.GameWorld;
19import helios.engine.runtime.world.UpdateContext;
20
21
22
23import helios.engine.modules.physics.collision.types.CollisionBehavior;
24
25import helios.engine.modules.physics.collision.components.CollisionStateComponent;
26
27import helios.engine.runtime.spawn.commands.DespawnCommand;
28
29import helios.engine.mechanics.lifecycle.components.Active;
30
34
35
36
37import helios.engine.common.tags.SystemRole;
38
40
41 /**
42 * @brief System that clears collision state components at the end of each frame.
43 *
44 * @details This system iterates over all entities with a CollisionStateComponent
45 * and resets their collision state. It should run in the post-phase of the game loop
46 * to ensure collision data from the current frame does not persist into the next frame.
47 *
48 * Running this system after collision response systems have processed their events
49 * ensures a clean slate for the next collision detection pass.
50 */
52
53 public:
54
56 /**
57 * @brief Resets collision state for all entities with CollisionStateComponent.
58 *
59 * @param updateContext Context containing frame data and world access.
60 */
62 for (auto [entity, csc, active] : updateContext.view<
65 >().whereEnabled()) {
66 csc->reset();
67 }
68 }
69
70 };
71
72
73}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.