Function addBoundingBox

Synopsis

#include <Source/Falcor/Utils/UI/DebugDrawer.h>

void addBoundingBox(const AABB &aabb)

Description

Adds a world space AABB

Source

Lines 59-74 in Source/Falcor/Utils/UI/DebugDrawer.cpp. Line 73 in Source/Falcor/Utils/UI/DebugDrawer.h.

void DebugDrawer::addBoundingBox(const AABB& aabb)
{
    float3 min = aabb.minPoint;
    float3 max = aabb.maxPoint;
    Quad bottomFace = { min, float3(max.x, min.y, min.z), float3(max.x, min.y, max.z), float3(min.x, min.y, max.z) };
    addQuad(bottomFace);
    Quad topFace = { float3(min.x, max.y, min.z), float3(max.x, max.y, min.z), max, float3(min.x, max.y, max.z) };
    addQuad(topFace);
    addLine(bottomFace[0], topFace[0]);
    addLine(bottomFace[1], topFace[1]);
    addLine(bottomFace[2], topFace[2]);
    addLine(bottomFace[3], topFace[3]);
}





Add Discussion as Guest

Log in