Claire's Game Engine
Full C++ Engine using OpenGL
Loading...
Searching...
No Matches
Box Struct Reference

Represents an axis-aligned bounding box (AABB) in 3D space. Used primarily for collision detection and spatial calculations. More...

#include <Box.h>

Public Member Functions

Vector3 GetSize () const
 Calculates the size (width, height, depth) of the box.
 
Vector3 GetCenter () const
 Calculates the center point of the box.
 

Static Public Member Functions

static bool Collision (const Box &a, const Box &b)
 Checks if two AABBs intersect (collide).
 

Public Attributes

Vector3 min = Vector3::One * -1.0f
 Minimum corner of the box in 3D space. Defaults to (-1, -1, -1).
 
Vector3 max = Vector3::One
 Maximum corner of the box in 3D space. Defaults to (1, 1, 1).
 

Detailed Description

Represents an axis-aligned bounding box (AABB) in 3D space. Used primarily for collision detection and spatial calculations.

Member Function Documentation

◆ Collision()

bool Box::Collision ( const Box & a,
const Box & b )
static

Checks if two AABBs intersect (collide).

Parameters
aThe first box.
bThe second box.
Returns
True if the boxes intersect, false otherwise.

◆ GetCenter()

Vector3 Box::GetCenter ( ) const

Calculates the center point of the box.

Returns
A Vector3 representing the center of the box.

◆ GetSize()

Vector3 Box::GetSize ( ) const

Calculates the size (width, height, depth) of the box.

Returns
A Vector3 representing the size of the box.

Member Data Documentation

◆ max

Vector3 Box::max = Vector3::One

Maximum corner of the box in 3D space. Defaults to (1, 1, 1).

◆ min

Vector3 Box::min = Vector3::One * -1.0f

Minimum corner of the box in 3D space. Defaults to (-1, -1, -1).


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