bounds Folder
Level boundary behavior components and systems. More...
Folders Index
| folder | components |
| folder | systems |
Files Index
| file | helios/engine/mechanics/bounds/_module.ixx |
|
Aggregate module for helios::engine::mechanics::bounds namespace. More... | |
| file | mechanics/bounds/registry.ixx |
|
Component registration for bounds module. More... | |
Description
Level boundary behavior components and systems.
helios::engine::mechanics::bounds
Level boundary behavior components and systems.
This module handles entity behavior when interacting with level boundaries, including bouncing, wrapping, and despawning.
Submodules
| Submodule | Purpose |
|---|---|
| components/ | Boundary behavior configuration per entity |
| systems/ | Boundary check and response logic |
Key Classes
| Class | Purpose |
|---|---|
| LevelBoundsBehaviorComponent | Stores behavior type (bounce, wrap, despawn) and restitution |
| LevelBoundsBehaviorSystem | Checks bounds and applies configured behavior |
Behavior Types
| Type | Effect |
|---|---|
| Bounce | Reflects velocity off boundary with restitution |
| Wrap | Teleports entity to opposite side |
| Despawn | Removes entity from world |
| Clamp | Stops at boundary edge |
Usage
// Configure projectile to despawn at boundaries
auto bullet = GameObjectFactory::gameObject()
.withCollision([](auto& c) {
c.levelBounds()
.behavior(LevelBoundsBehavior::Despawn);
})
.make(true);
// Configure enemy to bounce off boundaries
auto enemy = GameObjectFactory::gameObject()
.withCollision([](auto& c) {
c.levelBounds()
.behavior(LevelBoundsBehavior::Bounce)
.restitution(0.8f); // 80% velocity retained
})
.make(true);
// Add system to game loop
gameLoop.phase(PhaseType::Main).addPass()
.addSystem<LevelBoundsBehaviorSystem>(&gameWorld);
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.