Skip to main content

LevelBoundsCollisionConfig Class

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

Declaration

class helios::engine::builder::gameObject::builders::configs::LevelBoundsCollisionConfig { ... }

Public Constructors Index

LevelBoundsCollisionConfig (helios::engine::ecs::GameObject gameObject)

Constructs a LevelBoundsCollisionConfig. More...

Public Member Functions Index

LevelBoundsCollisionConfig &onCollision (helios::engine::modules::physics::collision::types::CollisionBehavior collisionBehavior)

Sets the collision behavior at level boundaries. More...

LevelBoundsCollisionConfig &restitution (const float restitution)

Sets the restitution coefficient for bounce behavior. More...

LevelBoundsCollisionConfig &respondWith (helios::engine::modules::physics::collision::types::CollisionResponse collisionResponse)

Sets the collision response type. More...

Private Member Functions Index

voidensureLevelBoundsBehaviorComponent (const bool isAvailable) const noexcept

Validates LevelBoundsBehaviorComponent presence. More...

Private Member Attributes Index

helios::engine::ecs::GameObjectgameObject_

Non-owning pointer to the target GameObject. More...

Description

Fluent configuration for level boundary collision behavior.

Provides methods for configuring how entities respond when reaching or crossing level boundaries.

Definition at line 26 of file LevelBoundsCollisionConfig.ixx.

Public Constructors

LevelBoundsCollisionConfig()

helios::engine::builder::gameObject::builders::configs::LevelBoundsCollisionConfig::LevelBoundsCollisionConfig (helios::engine::ecs::GameObject gameObject)
inline explicit

Constructs a LevelBoundsCollisionConfig.

Parameters
<a href="/docs/helios/namespaces/helios/engine/builder/gameobject">gameObject</a>

Target GameObject to configure.

Definition at line 57 of file LevelBoundsCollisionConfig.ixx.

Referenced by onCollision, respondWith and restitution.

Public Member Functions

onCollision()

LevelBoundsCollisionConfig & helios::engine::builder::gameObject::builders::configs::LevelBoundsCollisionConfig::onCollision (helios::engine::modules::physics::collision::types::CollisionBehavior collisionBehavior)
inline

Sets the collision behavior at level boundaries.

Parameters
collisionBehavior

The behavior (clamp, bounce, wrap, despawn).

Returns

Reference to this config for chaining.

Definition at line 66 of file LevelBoundsCollisionConfig.ixx.

67
69 .setCollisionBehavior(collisionBehavior);
70
71 return *this;
72 }

Reference LevelBoundsCollisionConfig.

respondWith()

LevelBoundsCollisionConfig & helios::engine::builder::gameObject::builders::configs::LevelBoundsCollisionConfig::respondWith (helios::engine::modules::physics::collision::types::CollisionResponse collisionResponse)
inline

Sets the collision response type.

Parameters
collisionResponse

How to respond (slide, stop, etc.).

Returns

Reference to this config for chaining.

Definition at line 96 of file LevelBoundsCollisionConfig.ixx.

97
99 .setCollisionResponse(collisionResponse);
100
101 return *this;
102 }

Reference LevelBoundsCollisionConfig.

restitution()

LevelBoundsCollisionConfig & helios::engine::builder::gameObject::builders::configs::LevelBoundsCollisionConfig::restitution (const float restitution)
inline

Sets the restitution coefficient for bounce behavior.

Parameters
restitution

Bounce factor (1.0 = perfect bounce).

Returns

Reference to this config for chaining.

Definition at line 81 of file LevelBoundsCollisionConfig.ixx.

82
84 .setRestitution(restitution);
85
86 return *this;
87 }

References LevelBoundsCollisionConfig and restitution.

Referenced by restitution.

Private Member Functions

ensureLevelBoundsBehaviorComponent()

void helios::engine::builder::gameObject::builders::configs::LevelBoundsCollisionConfig::ensureLevelBoundsBehaviorComponent (const bool isAvailable)
inline noexcept

Validates LevelBoundsBehaviorComponent presence.

Parameters
isAvailable

Whether the component should exist.

Definition at line 38 of file LevelBoundsCollisionConfig.ixx.

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 }

Private Member Attributes

gameObject_

helios::engine::ecs::GameObject helios::engine::builder::gameObject::builders::configs::LevelBoundsCollisionConfig::gameObject_

Non-owning pointer to the target GameObject.

Definition at line 31 of file LevelBoundsCollisionConfig.ixx.


The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.