Function volume

Synopsis

#include <Source/Falcor/Utils/Math/BBox.h>

float volume(float epsilon=0.0f) const

Description

Returns the volume of the bounding box.

Parameters:

[ in ] epsilon - Replace dimensions that are zero by this value.

Return
the volume of the bounding box if it is valid, -inf otherwise.

Source

Lines 66-75 in Source/Falcor/Utils/Math/BBox.h.

float volume(float epsilon = 0.0f) const
{
    if (valid() == false)
    {
        return -std::numeric_limits<float>::infinity();
    }
    const float3 dims = glm::max(float3(epsilon), dimensions());
    return dims.x * dims.y * dims.z;
}





Add Discussion as Guest

Log in to DocsForge