Skip to main content

BoundsUpdateSystem.ixx File

System for updating collider bounds based on world transforms. More...

Included Headers

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

classBoundsUpdateSystem

System that updates AABB colliders based on entity transforms. More...

Description

System for updating collider bounds based on world transforms.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file BoundsUpdateSystem.ixx
3 * @brief System for updating collider bounds based on world transforms.
4 */
5module;
6
7
8
9export module helios.engine.modules.physics.collision.systems.BoundsUpdateSystem;
10
11import helios.engine.modules.physics.collision.Bounds;
12
13import helios.engine.ecs.System;
14import helios.math;
15
16import helios.core.units.Unit;
17
18import helios.engine.ecs.GameObject;
19import helios.engine.runtime.world.GameWorld;
20import helios.engine.runtime.world.UpdateContext;
21
22import helios.engine.modules.scene.components.SceneNodeComponent;
23import helios.engine.modules.spatial.transform.components.ScaleStateComponent;
24import helios.engine.modules.spatial.transform.components.TranslationStateComponent;
25import helios.engine.modules.spatial.transform.components.RotationStateComponent;
26import helios.engine.modules.physics.collision.components.AabbColliderComponent;
27
28import helios.engine.modules.rendering.model.components.ModelAabbComponent;
29
30import helios.engine.mechanics.lifecycle.components.Active;
31
33
34 /**
35 * @brief System that updates AABB colliders based on entity transforms.
36 *
37 * @details
38 * This system recalculates the world-space AABB for entities by transforming
39 * the canonical model AABB through the composed local transform (Translation * Rotation * Scale)
40 * and the parent's world transform.
41 *
42 * Required components:
43 * - ModelAabbComponent (source canonical AABB)
44 * - SceneNodeComponent (for parent world transform)
45 * - TranslationStateComponent (local translation)
46 * - ScaleStateComponent (local scaling)
47 * - RotationStateComponent (local rotation)
48 * - AabbColliderComponent (receives the updated world-space AABB)
49 *
50 * @see helios::engine::modules::physics::collision::Bounds::computeWorldAabb()
51 */
53
54 public:
55
56 /**
57 * @brief Updates collider bounds for all applicable entities.
58 *
59 * @details
60 * For each entity with the required components, composes the local transform
61 * from translation, rotation, and scale, then applies the parent world transform
62 * to compute the final world-space AABB.
63 *
64 * @param updateContext Context containing deltaTime and other frame data.
65 */
66 void update(helios::engine::runtime::world::UpdateContext& updateContext) noexcept override {
67
68 for (auto [entity, mab, sc, tsc, sca, rsc, bc, active] : gameWorld_->view<
76 >().whereEnabled()) {
77
79 *mab, *sc, *tsc, *sca, *rsc
80 ));
81 }
82 }
83
84 };
85
86}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.