calculateAABB

AssetManagerInterface::calculateAABB

Calculate a Mesh’s AABB.

Declaration

virtual std::array<Math::vec3, 2> calculateAABB(const Mesh& mesh) = 0;

Parameters

Name

Type

Description

mesh

const Mesh&

The mesh to calculate the AABB of.

Returns

An std::array of 2 Math::vec3. The first one contains the minimum corner and the second one contains the maximum corner.

Notes

If a Mesh’s minimum corner’s axis (x, y or z) is equal to a maximum corner’s axis (which can happen if the mesh is a plane, for example), a small epsilon is deduced from this minimum corner’s axis and added to this maximum corner’s axis, to avoid the case where the AABB has no volume.