Skip to main content

LevelBoundsCollisionConfig.ixx File

Configuration for level boundary collision behavior. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

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

namespacebuilder

Fluent builder pattern for constructing GameObjects. More...

namespacegameObject

Factory and prototype classes for GameObject construction. More...

namespacebuilders

Domain-specific builders for configuring different aspects of GameObjects. More...

namespaceconfigs

Fine-grained configuration classes for component setup. More...

Classes Index

classLevelBoundsCollisionConfig

Fluent configuration for level boundary collision behavior. More...

Description

Configuration for level boundary collision behavior.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file LevelBoundsCollisionConfig.ixx
3 * @brief Configuration for level boundary collision behavior.
4 */
5module;
6
7#include <cassert>
8#include <memory>
9
10export module helios.engine.builder.gameObject.builders.configs.LevelBoundsCollisionConfig;
11
12import helios.engine.ecs.GameObject;
13
14import helios.engine.mechanics.bounds.components.LevelBoundsBehaviorComponent;
15import helios.engine.modules.physics.collision.types;
16
17
19
20 /**
21 * @brief Fluent configuration for level boundary collision behavior.
22 *
23 * Provides methods for configuring how entities respond when
24 * reaching or crossing level boundaries.
25 */
27
28 /**
29 * @brief Non-owning pointer to the target GameObject.
30 */
32
33 /**
34 * @brief Validates LevelBoundsBehaviorComponent presence.
35 *
36 * @param isAvailable Whether the component should exist.
37 */
38 void ensureLevelBoundsBehaviorComponent(const bool isAvailable) const noexcept {
39
41
42 if (isAvailable) {
43 assert(lbcc && "LevelBoundsBehaviorComponent not configured");
44 } else {
45 assert(!lbcc && "LevelBoundsBehaviorComponent already configured");
46 }
47
48 }
49
50 public:
51
52 /**
53 * @brief Constructs a LevelBoundsCollisionConfig.
54 *
55 * @param gameObject Target GameObject to configure.
56 */
58
59 /**
60 * @brief Sets the collision behavior at level boundaries.
61 *
62 * @param collisionBehavior The behavior (clamp, bounce, wrap, despawn).
63 *
64 * @return Reference to this config for chaining.
65 */
67
69 .setCollisionBehavior(collisionBehavior);
70
71 return *this;
72 }
73
74 /**
75 * @brief Sets the restitution coefficient for bounce behavior.
76 *
77 * @param restitution Bounce factor (1.0 = perfect bounce).
78 *
79 * @return Reference to this config for chaining.
80 */
82
84 .setRestitution(restitution);
85
86 return *this;
87 }
88
89 /**
90 * @brief Sets the collision response type.
91 *
92 * @param collisionResponse How to respond (slide, stop, etc.).
93 *
94 * @return Reference to this config for chaining.
95 */
97
99 .setCollisionResponse(collisionResponse);
100
101 return *this;
102 }
103
104
105 };
106
107}
108

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.