Skip to main content

components Folder

Files Index

filehelios/engine/modules/physics/collision/components/_module.ixx

Aggregate module for helios::engine::modules::physics::collision::components namespace. More...

fileAabbColliderComponent.ixx

Component for Axis-Aligned Bounding Box (AABB) collision detection. More...

fileCollisionComponent.ixx

Component for layer-based collision detection and event generation. More...

fileCollisionStateComponent.ixx

Per-frame collision state component written by detection systems. More...

Description

helios::engine::modules::physics::collision::components

Collider components for collision detection.

This namespace contains data components that define entity collision properties used by the physics and collision detection systems.

Components

ComponentDescription
AabbColliderComponentAxis-Aligned Bounding Box for broad-phase collision detection.
CollisionComponentLayer membership and collision masks (trigger/solid).
CollisionStateComponentPer-frame collision state written by detection systems.

Usage

Attach AabbColliderComponent to define spatial bounds and CollisionComponent to specify layer-based filtering. After collision detection runs, query CollisionStateComponent to read collision results for the current frame.

 auto& collider = gameObject.add<AabbColliderComponent>();
 collider.setBounds(helios::math::aabbf{{-0.5f, -0.5f, -0.5f}, {0.5f, 0.5f, 0.5f}});
 
 constexpr uint32_t LAYER_PLAYER = 1 << 0;
 constexpr uint32_t LAYER_ENEMY = 1 << 1;
 constexpr uint32_t LAYER_POWER_UP = 1 << 2;
 
 auto& collision = gameObject.add<CollisionComponent>(LAYER_PLAYER);
 collision.setTriggerCollisionMask(LAYER_ENEMY | LAYER_POWER_UP);


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.