Isle
Loading...
Searching...
No Matches
LegoBox Class Reference

[AI] Represents an axis-aligned 3D bounding box, defined by minimum and maximum corners. More...

#include <legobox.h>

Collaboration diagram for LegoBox:

Public Member Functions

LegoVertexGetMin ()
 [AI] Returns a reference to the minimum vertex of the box. More...
 
void SetMin (LegoVertex &p_min)
 [AI] Sets the minimum vertex of the box. More...
 
LegoVertexGetMax ()
 [AI] Returns a reference to the maximum vertex of the box. More...
 
void SetMax (LegoVertex &p_max)
 [AI] Sets the maximum vertex of the box. More...
 
LegoFloat GetDX ()
 [AI] Calculates the length of the box along the X axis. More...
 
LegoFloat GetDY ()
 [AI] Calculates the length of the box along the Y axis. More...
 
LegoFloat GetDZ ()
 [AI] Calculates the length of the box along the Z axis. More...
 
LegoBool IsEmpty ()
 [AI] Checks if both min and max vertices are set to the origin. More...
 
LegoResult Read (LegoStorage *p_storage)
 [AI] Reads the bounding box data from a LegoStorage stream. More...
 

Protected Attributes

LegoVertex m_min
 [AI] Minimum corner of the bounding box. More...
 
LegoVertex m_max
 [AI] Maximum corner of the bounding box. More...
 

Detailed Description

[AI] Represents an axis-aligned 3D bounding box, defined by minimum and maximum corners.

[AI]

[AI] The LegoBox class encapsulates an axis-aligned bounding box (AABB) in 3D space. It stores the minimum and maximum vertices, and provides operations for retrieving dimensions, checking for emptiness, and reading its data from storage. [AI]

Definition at line 11 of file legobox.h.

Member Function Documentation

◆ GetDX()

LegoFloat LegoBox::GetDX ( )
inline

[AI] Calculates the length of the box along the X axis.

[AI]

Returns
[AI] The extent along X (max.x - min.x). [AI]

Definition at line 50 of file legobox.h.

◆ GetDY()

LegoFloat LegoBox::GetDY ( )
inline

[AI] Calculates the length of the box along the Y axis.

[AI]

Returns
[AI] The extent along Y (max.y - min.y). [AI]

Definition at line 56 of file legobox.h.

◆ GetDZ()

LegoFloat LegoBox::GetDZ ( )
inline

[AI] Calculates the length of the box along the Z axis.

[AI]

Returns
[AI] The extent along Z (max.z - min.z). [AI]

Definition at line 62 of file legobox.h.

◆ GetMax()

LegoVertex & LegoBox::GetMax ( )
inline

[AI] Returns a reference to the maximum vertex of the box.

[AI]

Returns
[AI] Reference to the maximum corner vertex. [AI]

Definition at line 29 of file legobox.h.

◆ GetMin()

LegoVertex & LegoBox::GetMin ( )
inline

[AI] Returns a reference to the minimum vertex of the box.

[AI]

Returns
[AI] Reference to the minimum corner vertex. [AI]

Definition at line 17 of file legobox.h.

◆ IsEmpty()

LegoBool LegoBox::IsEmpty ( )
inline

[AI] Checks if both min and max vertices are set to the origin.

[AI]

Returns
[AI] True if both min and max are at the origin (box is "empty"). [AI]

[AI] A box is considered empty if both of its defining vertices are (0,0,0). [AI]

Definition at line 69 of file legobox.h.

◆ Read()

LegoResult LegoBox::Read ( LegoStorage p_storage)

[AI] Reads the bounding box data from a LegoStorage stream.

[AI]

Parameters
p_storagePointer to the LegoStorage instance to read from. [AI]
Returns
[AI] Result code indicating success or an error in reading either vertex. [AI]

[AI] Calls the Read methods of the min and max vertices in sequence. [AI]

Definition at line 10 of file legobox.cpp.

◆ SetMax()

void LegoBox::SetMax ( LegoVertex p_max)
inline

[AI] Sets the maximum vertex of the box.

[AI]

Parameters
p_maxThe LegoVertex to use as the maximum (corner) of the box. [AI]

Definition at line 35 of file legobox.h.

◆ SetMin()

void LegoBox::SetMin ( LegoVertex p_min)
inline

[AI] Sets the minimum vertex of the box.

[AI]

Parameters
p_minThe LegoVertex to use as the minimum (corner) of the box. [AI]

Definition at line 23 of file legobox.h.

Member Data Documentation

◆ m_max

LegoVertex LegoBox::m_max
protected

[AI] Maximum corner of the bounding box.

[AI]

Definition at line 88 of file legobox.h.

◆ m_min

LegoVertex LegoBox::m_min
protected

[AI] Minimum corner of the bounding box.

[AI]

Definition at line 83 of file legobox.h.


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