Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

class Geo::GeoBoundingBox

This class represents an axis aligned bounding box.

Variables

NameDescription
Geo::v128 v[2]

A min and max position pair.

Functions

NameDescription
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)

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.


Anchor
aec7cc0ad0f198de4a3fb00d83fc77a6b
aec7cc0ad0f198de4a3fb00d83fc77a6b

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.


Anchor
abdc4dc8605099ce24b28e527a740cea7
abdc4dc8605099ce24b28e527a740cea7

float Geo::GeoBoundingBox::CalculateSolidAngle

...

public: float CalculateSolidAngle
(
    v128 const & viewPos
) const

...

calculates the solid angle of the box as visible from viewPos


Anchor
a11fdec1915eaabb372b0ee9434fd6602
a11fdec1915eaabb372b0ee9434fd6602

Geo::v128 Geo::GeoBoundingBox::ClosestPointInBox

...

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

...

Compute the closest point in the box to p.


Anchor
a3009cb330f14ded9934a3ed2b44d3f5c
a3009cb330f14ded9934a3ed2b44d3f5c

bool Geo::GeoBoundingBox::ContainsBox

...

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

...

Is a box contained by the box?


Anchor
a5e348357d94e18794ea2df7a548e7e7e
a5e348357d94e18794ea2df7a548e7e7e

bool Geo::GeoBoundingBox::ContainsPoint

...

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

...

Is a point in the box?


Anchor
aa3ea0a9b765ac1e1b3ecf97e2514712f
aa3ea0a9b765ac1e1b3ecf97e2514712f

bool Geo::GeoBoundingBox::ContainsPoint2D

...

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

...

Is a point in the box? Only tests xy.


Anchor
ad027ce9b7bc9ca796abde377b887e4d5
ad027ce9b7bc9ca796abde377b887e4d5

void Geo::GeoBoundingBox::EnclosePoint

...

public: void EnclosePoint
(
    const v128 & point
)

...

Enlarge this bounding box to include the given point.


Anchor
af10700edd9fbc07a8f7f421155750c45
af10700edd9fbc07a8f7f421155750c45

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).


Anchor
ab42bb1e1b509ef18ca5930231853ecef
ab42bb1e1b509ef18ca5930231853ecef

Geo::GeoBoundingBox::GeoBoundingBox

...

public: GeoBoundingBox()

...

Constructor - makes an empty bounding box.


Anchor
a315bcebf179293c57ef7e9c6ef1709df
a315bcebf179293c57ef7e9c6ef1709df

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.


Anchor
ae5731e78adc897644ea7c74df30e6a97
ae5731e78adc897644ea7c74df30e6a97

Geo::GeoBoundingBox::GeoBoundingBox

...

public: GeoBoundingBox
(
    const GeoBoundingBox & from
)

...

Copy Constructor.


Anchor
af064e35df8a25cdc3481ccdd619c2eb4
af064e35df8a25cdc3481ccdd619c2eb4

v128 Geo::GeoBoundingBox::GetCenter

...

public: v128 GetCenter() const

...

Return the center of this bounding box.


Anchor
a9b01ee714e0d5319c5987a9e012c5ffc
a9b01ee714e0d5319c5987a9e012c5ffc

void Geo::GeoBoundingBox::GetCorners

...

public: void GetCorners
(
    v128 * corners
) const

...

Return the 8 corner points.


Anchor
a7d285c20e02b3674ce52548ae2b293e9
a7d285c20e02b3674ce52548ae2b293e9

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.


Anchor
ac9e2400a99a352ac77452dc1799f2f6a
ac9e2400a99a352ac77452dc1799f2f6a

float Geo::GeoBoundingBox::GetDistanceFrom

...

public: float GetDistanceFrom
(
    const GeoBoundingBox & rhs
) const

...

Distance between two bounding boxes (0 if they intersect)


Anchor
a4d76b598908786d7491adec7d4bf3c9e
a4d76b598908786d7491adec7d4bf3c9e

float Geo::GeoBoundingBox::GetLargestFace

...

public: float GetLargestFace() const

...

Return the largest face of this bounding box.


Anchor
a4335a395d4cb00b3696e9739963a0ae0
a4335a395d4cb00b3696e9739963a0ae0

float Geo::GeoBoundingBox::GetLongestSide

...

public: float GetLongestSide() const

...

Return the longest side of this bounding box.


Anchor
ab7031ad25f24f33bc44805b1b2cea4e2
ab7031ad25f24f33bc44805b1b2cea4e2

Geo::s32 Geo::GeoBoundingBox::GetLongestSideIdx

...

public: Geo::s32 GetLongestSideIdx() const

...

Returns the index of the longest axis.


Anchor
a9b7e2d693cfee7b61dfabd38fceb3f85
a9b7e2d693cfee7b61dfabd38fceb3f85

v128 Geo::GeoBoundingBox::GetMax

...

public: v128 GetMax() const

...

Return the maxumum in each axis of this bounding box.


Anchor
a007d099fb32e48e4fb60ba15caf6306c
a007d099fb32e48e4fb60ba15caf6306c

v128 Geo::GeoBoundingBox::GetMin

...

public: v128 GetMin() const

...

Return the minimum in each axis of this bounding box.


Anchor
a865792c932104ddea48c6c80858059f5
a865792c932104ddea48c6c80858059f5

float Geo::GeoBoundingBox::GetShortestSide

...

public: float GetShortestSide() const

...

Return the shortest side of this bounding box.


Anchor
a7c655eefa51b785272f0c9c8524a328d
a7c655eefa51b785272f0c9c8524a328d

v128 Geo::GeoBoundingBox::GetSize

...

public: v128 GetSize() const

...

Return the size of this bounding box in each axis.


Anchor
a9d708fa3943212e066f2393969241010
a9d708fa3943212e066f2393969241010

float Geo::GeoBoundingBox::GetSurfaceArea

...

public: float GetSurfaceArea() const

...

Return the surface area of this bounding box.


Anchor
a94c7c660e272740fbeaf5b33f1fa48c9
a94c7c660e272740fbeaf5b33f1fa48c9

float Geo::GeoBoundingBox::GetVolume

...

public: float GetVolume() const

...

Return the volume of this bounding box.


Anchor
a0b817437e3b48b14e202e26ffe5e3434
a0b817437e3b48b14e202e26ffe5e3434

bool Geo::GeoBoundingBox::IntersectsBoundingBox

...

public: bool IntersectsBoundingBox
(
    const GeoBoundingBox & rhs
) const

...

Returns true if the bounding boxes mutually olaps.


Anchor
a0a3e051607ea7f1d41798486c464c4ba
a0a3e051607ea7f1d41798486c464c4ba

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.


Anchor
a50042a12593c0db7d8b4f9e488f9f393
a50042a12593c0db7d8b4f9e488f9f393

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.


Anchor
a6cfbf191dcc2875eb00d7fcba0392a33
a6cfbf191dcc2875eb00d7fcba0392a33

bool Geo::GeoBoundingBox::IntersectsSphere

...

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

...

Returns true if the bounding box overlaps the sphere.


Anchor
a6fc9f5078cdfdd2344a2ccfffb5f857f
a6fc9f5078cdfdd2344a2ccfffb5f857f

bool Geo::GeoBoundingBox::IntersectsSphere

...

public: bool IntersectsSphere
(
    const GeoBoundingSphere & bSphere
) const

...

Returns true if the bounding box overlaps the sphere.


Anchor
a054da0d287f4b879eeb69d7928d1f109
a054da0d287f4b879eeb69d7928d1f109

bool Geo::GeoBoundingBox::IsEmpty

...

public: bool IsEmpty() const

...

Returns true if the bbox is empty (ie uninitialised)


Anchor
a4a9006c68abe8b1d0b98eb9655d54ba4
a4a9006c68abe8b1d0b98eb9655d54ba4

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).


Anchor
af21e0cbc070e3819b2df451ed48e55ea
af21e0cbc070e3819b2df451ed48e55ea

GeoBoundingBox Geo::GeoBoundingBox::operator+

...

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

...

Compute and return the union of this bounding with another.


Anchor
abdc510e873ae949eb4cd66f699024c5e
abdc510e873ae949eb4cd66f699024c5e

GeoBoundingBox & Geo::GeoBoundingBox::operator+=

...

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

...

Enlarge this bounding box to include the given point.


Anchor
ac14c070d2f3fabbbbaec2a09768c2887
ac14c070d2f3fabbbbaec2a09768c2887

GeoBoundingBox & Geo::GeoBoundingBox::operator+=

...

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

...

Compute the inplace union of this bounding box and another.


Anchor
ad92238e9584de24b74c195865991ef05
ad92238e9584de24b74c195865991ef05

void Geo::GeoBoundingBox::SetEmpty

...

public: void SetEmpty()

...

Resets the box to it's default empty state.


Anchor
a28ce26e7c6de6ad773372906b6b723ed
a28ce26e7c6de6ad773372906b6b723ed

GeoBoundingBox Geo::GeoBoundingBox::Transform

...

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

...

Returns a new transformed bounding box.