Skip to main content

Bounds Namespace

Definition

namespace helios::engine::modules::physics::collision::Bounds { ... }

Functions Index

helios::math::aabbfcomputeWorldAabb (const helios::engine::modules::rendering::model::components::ModelAabbComponent &mab, const helios::engine::modules::scene::components::SceneNodeComponent &sc, const helios::engine::modules::spatial::transform::components::TranslationStateComponent &tsc, const helios::engine::modules::spatial::transform::components::ScaleStateComponent &sca, helios::engine::modules::spatial::transform::components::RotationStateComponent &rsc) noexcept

Computes the world-space AABB from local model bounds and transforms. More...

Functions

computeWorldAabb()

Computes the world-space AABB from local model bounds and transforms.

Combines the parent's world transform with the entity's local translation, rotation, and scale to transform the model-space AABB into world space.

The transformation order is: Translation * Rotation * Scale (TRS).

Parameters
mab

Model AABB component containing the local bounding box.

sc

Scene node component for accessing parent world transform.

tsc

Translation state component with local position.

sca

Scale state component with local scaling factors.

rsc

Rotation state component with local rotation matrix.

Returns

World-space axis-aligned bounding box.

Definition at line 43 of file Bounds.ixx.

49 ) noexcept {
50
51 const helios::math::mat4f& parentTransform = sc.sceneNode()->parent()->worldTransform();
52
53 const helios::math::vec3f localTranslation = tsc.translation();
54 const helios::math::mat4f localRotation = rsc.rotation();
55 const helios::math::vec3f localScaling = sca.scaling();
56
57 const helios::math::mat4f mScaling = helios::math::mat4f::identity().withScaling(localScaling);
58 const helios::math::mat4f mTranslation = helios::math::mat4f::identity().withTranslation(localTranslation);
59
60 const helios::math::mat4f localTransform = mTranslation * (localRotation * mScaling);
61
62 return mab.aabb().applyTransform(parentTransform * localTransform);
63 }

Reference helios::math::mat4< float >::identity.

Referenced by helios::engine::modules::physics::collision::systems::BoundsUpdateSystem::update.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.