Skip to main content

ModelAabbComponent.ixx File

Component for storing the canonical AABB of a model. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

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

namespacemodules

Domain-specific components and systems. More...

namespacerendering

Rendering components for game entities. More...

namespacemodel
namespacecomponents

Classes Index

classModelAabbComponent

Component that stores the canonical Axis-Aligned Bounding Box (AABB) of a model. More...

Description

Component for storing the canonical AABB of a model.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file ModelAabbComponent.ixx
3 * @brief Component for storing the canonical AABB of a model.
4 */
5module;
6
7export module helios.engine.modules.rendering.model.components.ModelAabbComponent;
8
9import helios.math.types;
10
11import helios.core.spatial.Transform;
12
14
15 /**
16 * @brief Component that stores the canonical Axis-Aligned Bounding Box (AABB) of a model.
17 *
18 * @details
19 * This component is used to associate spatial bounds with an entity, typically derived
20 * from a 3D model or mesh. It is essential for culling, collision detection, and
21 * other spatial queries.
22 */
24
25 /**
26 * @brief The stored AABB.
27 */
29
30 /**
31 * @brief Whether this component is enabled.
32 */
33 bool isEnabled_ = true;
34
35 public:
36
37 /**
38 * @brief Checks whether this component is enabled.
39 *
40 * @return True if enabled, false otherwise.
41 */
42 [[nodiscard]] bool isEnabled() const noexcept {
43 return isEnabled_;
44 }
45
46 /**
47 * @brief Enables this component.
48 */
49 void enable() noexcept {
50 isEnabled_ = true;
51 }
52
53 /**
54 * @brief Disables this component.
55 */
56 void disable() noexcept {
57 isEnabled_ = false;
58 }
59
60 /**
61 * @brief Default constructor.
62 */
63 ModelAabbComponent() = default;
64
66 aabb_(other.aabb_) {}
67
70 ModelAabbComponent& operator=(ModelAabbComponent&&) noexcept = default;
71
72 /**
73 * @brief Sets the AABB for this component.
74 *
75 * @param aabb The new AABB to store.
76 */
77 void setAabb(const helios::math::aabbf& aabb) {
78 aabb_ = aabb;
79 }
80
81
82 /**
83 * @brief Retrieves the stored AABB.
84 *
85 * @return Constant reference to the AABB.
86 */
87 [[nodiscard]] const helios::math::aabbf& aabb() const noexcept {
88 return aabb_;
89 }
90 };
91
92}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.