SaturnRingLibrary 0.9.1
SGL wrapper
 
Loading...
Searching...
No Matches

◆ GetVolume()

Fxp SRL::Math::Types::AABB::GetVolume ( ) const
inlineconstexpr

Calculate the volume of the AABB.

This function computes the volume of the Axis-Aligned Bounding Box (AABB) based on its half-extents. The volume is calculated using the formula:

Volume = width * height * depth

Since the size represents half-extents, the actual dimensions of the AABB are:

  • Width = size.X * 2
  • Height = size.Y * 2
  • Depth = size.Z * 2

Therefore, the volume is computed as:

Volume = (size.X * 2) * (size.Y * 2) * (size.Z * 2) = size.X * size.Y * size.Z * 8
Returns
The volume as an Fxp value, representing the total volume of the AABB.