VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
visutwin::canvas::BoundingBox Class Reference

Axis-Aligned Bounding Box defined by center and half-extents. More...

#include <core/shape/boundingBox.h>

Public Member Functions

void add (const BoundingBox &other)
 BoundingBox ()
 BoundingBox (const Vector3 &center, const Vector3 &halfExtents)
const Vector3center () const
const Vector3halfExtents () const
void setCenter (const Vector3 &center)
void setCenter (float x, float y, float z)
void setFromTransformedAabb (const BoundingBox &aabb, const Matrix4 &m, bool ignoreScale=false)
void setHalfExtents (const Vector3 &halfExtents)
void setHalfExtents (float x, float y, float z)

Detailed Description

Axis-Aligned Bounding Box defined by center and half-extents.

Used for frustum culling, spatial queries, and broad-phase collision detection. Supports union (add), transform, and intersection tests against rays, spheres, and other AABBs.

Definition at line 20 of file boundingBox.h.

Constructor & Destructor Documentation

◆ BoundingBox() [1/2]

visutwin::canvas::BoundingBox::BoundingBox ( )
inline

Definition at line 23 of file boundingBox.h.

Referenced by add(), and setFromTransformedAabb().

◆ BoundingBox() [2/2]

visutwin::canvas::BoundingBox::BoundingBox ( const Vector3 & center,
const Vector3 & halfExtents )
inline

Definition at line 24 of file boundingBox.h.

References center(), and halfExtents().

Member Function Documentation

◆ add()

void visutwin::canvas::BoundingBox::add ( const BoundingBox & other)

Combines two bounding boxes into one, enclosing both. Modifies this bounding box in place.

Definition at line 74 of file boundingBox.cpp.

References BoundingBox(), center(), visutwin::canvas::Vector3::getX(), visutwin::canvas::Vector3::getY(), visutwin::canvas::Vector3::getZ(), and halfExtents().

Referenced by visutwin::canvas::Batch::updateBoundingBox(), and visutwin::canvas::CollisionComponent::worldBounds().

◆ center()

◆ halfExtents()

◆ setCenter() [1/2]

◆ setCenter() [2/2]

void visutwin::canvas::BoundingBox::setCenter ( float x,
float y,
float z )
inline

Definition at line 30 of file boundingBox.h.

◆ setFromTransformedAabb()

void visutwin::canvas::BoundingBox::setFromTransformedAabb ( const BoundingBox & aabb,
const Matrix4 & m,
bool ignoreScale = false )

◆ setHalfExtents() [1/2]

◆ setHalfExtents() [2/2]

void visutwin::canvas::BoundingBox::setHalfExtents ( float x,
float y,
float z )
inline

Definition at line 38 of file boundingBox.h.


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