Skip to main content

AabbColliderComponent Class

Component that defines an Axis-Aligned Bounding Box (AABB) for physics interactions. More...

Declaration

class helios::engine::modules::physics::collision::components::AabbColliderComponent { ... }

Public Constructors Index

AabbColliderComponent ()=default

Default constructor. More...

AabbColliderComponent (const AabbColliderComponent &other)

Copy constructor. More...

AabbColliderComponent (AabbColliderComponent &&) noexcept=default

Public Operators Index

AabbColliderComponent &operator= (const AabbColliderComponent &)=default
AabbColliderComponent &operator= (AabbColliderComponent &&) noexcept=default

Public Member Functions Index

boolisEnabled () const noexcept

Checks whether this component is enabled. More...

voidenable () noexcept

Enables this component. More...

voiddisable () noexcept

Disables this component. More...

voidonAcquire () noexcept

Resets the bounds to invalidate state when this Component is acquired. More...

voidonRelease () noexcept

Resets the bounds to invalidate state when this Component is released. More...

const helios::math::aabbf &bounds ()

Retrieves the bounds of the collider. More...

voidsetBounds (const helios::math::aabbf &bounds)

Sets the bounds of the collider. More...

boolboundsInitialized () const noexcept

Checks whether the bounds of the collider have been initialized. More...

Private Member Attributes Index

helios::math::aabbfbounds_

The local bounds of the collider. More...

boolisEnabled_ = true

Whether this component is enabled. More...

Description

Component that defines an Axis-Aligned Bounding Box (AABB) for physics interactions.

This component attaches a spatial bounding box to a GameObject, which can be used by physics systems for broad-phase collision detection or simple trigger interactions.

Definition at line 23 of file AabbColliderComponent.ixx.

Public Constructors

AabbColliderComponent()

helios::engine::modules::physics::collision::components::AabbColliderComponent::AabbColliderComponent ()
explicit default

Default constructor.

Definition at line 63 of file AabbColliderComponent.ixx.

Referenced by AabbColliderComponent, AabbColliderComponent, operator= and operator=.

AabbColliderComponent()

helios::engine::modules::physics::collision::components::AabbColliderComponent::AabbColliderComponent (const AabbColliderComponent & other)
inline

Copy constructor.

Preserves the bounds of this component.

Definition at line 70 of file AabbColliderComponent.ixx.

71 bounds_(other.bounds_) {}

Reference AabbColliderComponent.

AabbColliderComponent()

helios::engine::modules::physics::collision::components::AabbColliderComponent::AabbColliderComponent (AabbColliderComponent &&)
noexcept default

Definition at line 74 of file AabbColliderComponent.ixx.

Reference AabbColliderComponent.

Public Operators

operator=()

AabbColliderComponent & helios::engine::modules::physics::collision::components::AabbColliderComponent::operator= (const AabbColliderComponent &)
default

Definition at line 73 of file AabbColliderComponent.ixx.

Reference AabbColliderComponent.

operator=()

AabbColliderComponent & helios::engine::modules::physics::collision::components::AabbColliderComponent::operator= (AabbColliderComponent &&)
noexcept default

Definition at line 75 of file AabbColliderComponent.ixx.

Reference AabbColliderComponent.

Public Member Functions

bounds()

const helios::math::aabbf & helios::engine::modules::physics::collision::components::AabbColliderComponent::bounds ()
inline nodiscard

Retrieves the bounds of the collider.

Returns

A const reference to the AABB.

Definition at line 96 of file AabbColliderComponent.ixx.

96 [[nodiscard]] const helios::math::aabbf& bounds() {
97 return bounds_;
98 }

Referenced by setBounds and helios::engine::modules::physics::collision::systems::GridCollisionDetectionSystem::solveCell.

boundsInitialized()

bool helios::engine::modules::physics::collision::components::AabbColliderComponent::boundsInitialized ()
inline nodiscard noexcept

Checks whether the bounds of the collider have been initialized.

Bounds of the collider component are considered to be initialized if the minimum X coordinate is less or equal to the maximum X coordinate.

Returns

true if the bounds are considered to be initialized; otherwise, false.

Definition at line 117 of file AabbColliderComponent.ixx.

117 [[nodiscard]] bool boundsInitialized() const noexcept {
118 return bounds_.min()[0] <= bounds_.max()[0];
119 }

disable()

void helios::engine::modules::physics::collision::components::AabbColliderComponent::disable ()
inline noexcept

Disables this component.

Definition at line 56 of file AabbColliderComponent.ixx.

56 void disable() noexcept {
57 isEnabled_ = false;
58 }

enable()

void helios::engine::modules::physics::collision::components::AabbColliderComponent::enable ()
inline noexcept

Enables this component.

Definition at line 49 of file AabbColliderComponent.ixx.

49 void enable() noexcept {
50 isEnabled_ = true;
51 }

isEnabled()

bool helios::engine::modules::physics::collision::components::AabbColliderComponent::isEnabled ()
inline nodiscard noexcept

Checks whether this component is enabled.

Returns

True if enabled, false otherwise.

Definition at line 42 of file AabbColliderComponent.ixx.

42 [[nodiscard]] bool isEnabled() const noexcept {
43 return isEnabled_;
44 }

onAcquire()

void helios::engine::modules::physics::collision::components::AabbColliderComponent::onAcquire ()
inline noexcept

Resets the bounds to invalidate state when this Component is acquired.

Definition at line 80 of file AabbColliderComponent.ixx.

80 void onAcquire() noexcept {
81 bounds_ = {};
82 }

Reference onAcquire.

Referenced by onAcquire.

onRelease()

void helios::engine::modules::physics::collision::components::AabbColliderComponent::onRelease ()
inline noexcept

Resets the bounds to invalidate state when this Component is released.

Definition at line 87 of file AabbColliderComponent.ixx.

87 void onRelease() noexcept {
88 bounds_ = {};
89 }

setBounds()

void helios::engine::modules::physics::collision::components::AabbColliderComponent::setBounds (const helios::math::aabbf & bounds)
inline

Sets the bounds of the collider.

Parameters
bounds

The new AABB to set.

Definition at line 105 of file AabbColliderComponent.ixx.

106 bounds_ = bounds;
107 }

Reference bounds.

Private Member Attributes

bounds_

helios::math::aabbf helios::engine::modules::physics::collision::components::AabbColliderComponent::bounds_

The local bounds of the collider.

Definition at line 28 of file AabbColliderComponent.ixx.

isEnabled_

bool helios::engine::modules::physics::collision::components::AabbColliderComponent::isEnabled_ = true

Whether this component is enabled.

Definition at line 33 of file AabbColliderComponent.ixx.

33 bool isEnabled_ = true;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.