This is the documentation for Enlighten.

class Geo GeoBoundingBox

class Geo::GeoBoundingBox

This class represents an axis aligned bounding box.

Variables

Name Description
Geo::v128 v[2]

A min and max position pair.

Functions

Name Description
AddDebugLines(Geo::GeoArray< DebugLine > &)

Appends to the contents of the given array with the lines making up the bounding box.

CalculateSolidAngle(v128 const &)

calculates the solid angle of the box as visible from viewPos

ClosestPointInBox(const Geo::v128 &)

Compute the closest point in the box to p.

ContainsBox(const Geo::GeoBoundingBox &)

Is a box contained by the box?

ContainsPoint(const Geo::v128 &)

Is a point in the box?

ContainsPoint2D(const Geo::v128 &)

Is a point in the box? Only tests xy.

EnclosePoint(const v128 &)

Enlarge this bounding box to include the given point.

ExpandBy(const v128 &)

Expands this bounding box by the given amount in each of the three axes (in both directions).

GeoBoundingBox()

Constructor - makes an empty bounding box.

GeoBoundingBox(float, float, float, float, float, float)

Create a bounding box defined by two extreme points.

GeoBoundingBox(const GeoBoundingBox &)

Copy Constructor.

GetCenter()

Return the center of this bounding box.

GetCorners(v128 *)

Return the 8 corner points.

GetDebugLines(Geo::GeoArray< DebugLine > &)

Replaces the contents of the given array with the lines making up the bounding box.

GetDistanceFrom(const GeoBoundingBox &)

Distance between two bounding boxes (0 if they intersect)

GetDistanceFrom(const Geo::v128 &)

Compute the closest distance from p.

GetLargestFace()

Return the largest face of this bounding box.

GetLongestSide()

Return the longest side of this bounding box.

GetLongestSideIdx()

Returns the index of the longest axis.

GetMax()

Return the maxumum in each axis of this bounding box.

GetMin()

Return the minimum in each axis of this bounding box.

GetShortestSide()

Return the shortest side of this bounding box.

GetSize()

Return the size of this bounding box in each axis.

GetSurfaceArea()

Return the surface area of this bounding box.

GetVolume()

Return the volume of this bounding box.

IntersectsBoundingBox(const GeoBoundingBox &)

Returns true if the bounding boxes mutually olaps.

IntersectsLightCone(const Geo::v128 &, const Geo::v128 &, float, float)

Returns true if the bounding box intersects the light cone.

IntersectsRay(const Geo::v128 &, const Geo::v128 &, float &)

Returns true if the bounding box intersects the ray. If intersects then tHit return the distance to the hit.

IntersectsSphere(Geo::v128, float)

Returns true if the bounding box overlaps the sphere.

IntersectsSphere(const GeoBoundingSphere &)

Returns true if the bounding box overlaps the sphere.

IsEmpty()

Returns true if the bbox is empty (ie uninitialised)

operator[](Geo::u32)

Indexed access to the two extreme points that define this bounding box (index must be 0 or 1).

operator+(const GeoBoundingBox &)

Compute and return the union of this bounding with another.

operator+=(const v128 &)

Enlarge this bounding box to include the given point.

operator+=(const GeoBoundingBox &)

Compute the inplace union of this bounding box and another.

SetEmpty()

Resets the box to it's default empty state.

Transform(const Geo::Matrix &)

Returns a new transformed bounding box.


bool Geo::GeoBoundingBox::AddDebugLines


public: bool AddDebugLines
(
    Geo::GeoArray< DebugLine > & lines
) const


Appends to the contents of the given array with the lines making up the bounding box.


float Geo::GeoBoundingBox::CalculateSolidAngle


public: float CalculateSolidAngle
(
    v128 const & viewPos
) const


calculates the solid angle of the box as visible from viewPos


Geo::v128 Geo::GeoBoundingBox::ClosestPointInBox


public: Geo::v128 ClosestPointInBox
(
    const Geo::v128 & p
) const


Compute the closest point in the box to p.


bool Geo::GeoBoundingBox::ContainsBox


public: bool ContainsBox
(
    const Geo::GeoBoundingBox & rhs
) const


Is a box contained by the box?


bool Geo::GeoBoundingBox::ContainsPoint


public: bool ContainsPoint
(
    const Geo::v128 & p
) const


Is a point in the box?


bool Geo::GeoBoundingBox::ContainsPoint2D


public: bool ContainsPoint2D
(
    const Geo::v128 & p
) const


Is a point in the box? Only tests xy.


void Geo::GeoBoundingBox::EnclosePoint


public: void EnclosePoint
(
    const v128 & point
)


Enlarge this bounding box to include the given point.


void Geo::GeoBoundingBox::ExpandBy


public: void ExpandBy
(
    const v128 & expansion
)


Expands this bounding box by the given amount in each of the three axes (in both directions).


Geo::GeoBoundingBox::GeoBoundingBox


public: GeoBoundingBox()


Constructor - makes an empty bounding box.


Geo::GeoBoundingBox::GeoBoundingBox


public: GeoBoundingBox
(
    float x1,
    float y1,
    float z1,
    float x2,
    float y2,
    float z2
)


Create a bounding box defined by two extreme points.


Geo::GeoBoundingBox::GeoBoundingBox


public: GeoBoundingBox
(
    const GeoBoundingBox & from
)


Copy Constructor.


v128 Geo::GeoBoundingBox::GetCenter


public: v128 GetCenter() const


Return the center of this bounding box.


void Geo::GeoBoundingBox::GetCorners


public: void GetCorners
(
    v128 * corners
) const


Return the 8 corner points.


bool Geo::GeoBoundingBox::GetDebugLines


public: bool GetDebugLines
(
    Geo::GeoArray< DebugLine > & lines
) const


Replaces the contents of the given array with the lines making up the bounding box.


float Geo::GeoBoundingBox::GetDistanceFrom


public: float GetDistanceFrom
(
    const GeoBoundingBox & rhs
) const


Distance between two bounding boxes (0 if they intersect)


float Geo::GeoBoundingBox::GetDistanceFrom


public: float GetDistanceFrom
(
    const Geo::v128 & p
) const


Compute the closest distance from p.


float Geo::GeoBoundingBox::GetLargestFace


public: float GetLargestFace() const


Return the largest face of this bounding box.


float Geo::GeoBoundingBox::GetLongestSide


public: float GetLongestSide() const


Return the longest side of this bounding box.


Geo::s32 Geo::GeoBoundingBox::GetLongestSideIdx


public: Geo::s32 GetLongestSideIdx() const


Returns the index of the longest axis.


v128 Geo::GeoBoundingBox::GetMax


public: v128 GetMax() const


Return the maxumum in each axis of this bounding box.


v128 Geo::GeoBoundingBox::GetMin


public: v128 GetMin() const


Return the minimum in each axis of this bounding box.


float Geo::GeoBoundingBox::GetShortestSide


public: float GetShortestSide() const


Return the shortest side of this bounding box.


v128 Geo::GeoBoundingBox::GetSize


public: v128 GetSize() const


Return the size of this bounding box in each axis.


float Geo::GeoBoundingBox::GetSurfaceArea


public: float GetSurfaceArea() const


Return the surface area of this bounding box.


float Geo::GeoBoundingBox::GetVolume


public: float GetVolume() const


Return the volume of this bounding box.


bool Geo::GeoBoundingBox::IntersectsBoundingBox


public: bool IntersectsBoundingBox
(
    const GeoBoundingBox & rhs
) const


Returns true if the bounding boxes mutually olaps.


bool Geo::GeoBoundingBox::IntersectsLightCone


public: bool IntersectsLightCone
(
    const Geo::v128 & lightPosition,
    const Geo::v128 & lightDirection,
    float coneAngle,
    float cutOff
) const


Returns true if the bounding box intersects the light cone.


bool Geo::GeoBoundingBox::IntersectsRay


public: bool IntersectsRay
(
    const Geo::v128 & rayPosition,
    const Geo::v128 & rayDirection,
    float & tHit
) const


Returns true if the bounding box intersects the ray. If intersects then tHit return the distance to the hit.


bool Geo::GeoBoundingBox::IntersectsSphere


public: bool IntersectsSphere
(
    Geo::v128 centre,
    float radius
) const


Returns true if the bounding box overlaps the sphere.


bool Geo::GeoBoundingBox::IntersectsSphere


public: bool IntersectsSphere
(
    const GeoBoundingSphere & bSphere
) const


Returns true if the bounding box overlaps the sphere.


bool Geo::GeoBoundingBox::IsEmpty


public: bool IsEmpty() const


Returns true if the bbox is empty (ie uninitialised)


const v128 & Geo::GeoBoundingBox::operator[]


public: const v128 & operator[]
(
    Geo::u32 index
) const


Indexed access to the two extreme points that define this bounding box (index must be 0 or 1).


GeoBoundingBox Geo::GeoBoundingBox::operator+


public: GeoBoundingBox operator+
(
    const GeoBoundingBox & rhs
) const


Compute and return the union of this bounding with another.


GeoBoundingBox & Geo::GeoBoundingBox::operator+=


public: GeoBoundingBox & operator+=
(
    const v128 & rhs
)


Enlarge this bounding box to include the given point.


GeoBoundingBox & Geo::GeoBoundingBox::operator+=


public: GeoBoundingBox & operator+=
(
    const GeoBoundingBox & rhs
)


Compute the inplace union of this bounding box and another.


void Geo::GeoBoundingBox::SetEmpty


public: void SetEmpty()


Resets the box to it's default empty state.


GeoBoundingBox Geo::GeoBoundingBox::Transform


public: GeoBoundingBox Transform
(
    const Geo::Matrix & transform
) const


Returns a new transformed bounding box.