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

◆ GetSurfaceArea()

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

Calculate the surface area of the AABB.

This function computes the surface area of the Axis-Aligned Bounding Box (AABB). The surface area is calculated using the formula:

Surface Area = 2 * (width * height + height * depth + depth * width)

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 surface area is computed as:

Surface Area = 2 * ((size.X * 2) * (size.Y * 2) + (size.Y * 2) * (size.Z * 2) + (size.Z * 2) * (size.X * 2))
= (size.X * size.Y + size.Y * size.Z + size.Z * size.X) * 2
Returns
The surface area as an Fxp value, representing the total surface area of the AABB.