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 |
|---|---|
Appends to the contents of the given array with the lines making up the bounding box. | |
calculates the solid angle of the box as visible from viewPos | |
Compute the closest point in the box to p. | |
Is a box contained by the box? | |
Is a point in the box? | |
Is a point in the box? Only tests xy. | |
Enlarge this bounding box to include the given point. | |
Expands this bounding box by the given amount in each of the three axes (in both directions). | |
Constructor - makes an empty bounding box. | |
Create a bounding box defined by two extreme points. | |
Copy Constructor. | |
Return the center of this bounding box. | |
Return the 8 corner points. | |
Replaces the contents of the given array with the lines making up the bounding box. | |
Distance between two bounding boxes (0 if they intersect) | |
Compute the closest distance from p. | |
Return the largest face of this bounding box. | |
Return the longest side of this bounding box. | |
Returns the index of the longest axis. | |
Return the maxumum in each axis of this bounding box. | |
Return the minimum in each axis of this bounding box. | |
Return the shortest side of this bounding box. | |
Return the size of this bounding box in each axis. | |
Return the surface area of this bounding box. | |
Return the volume of this bounding box. | |
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. |
Returns true if the bounding box overlaps the sphere. | |
Returns true if the bounding box overlaps the sphere. | |
Returns true if the bbox is empty (ie uninitialised) | |
Indexed access to the two extreme points that define this bounding box (index must be 0 or 1). | |
Compute and return the union of this bounding with another. | |
Enlarge this bounding box to include the given point. | |
Compute the inplace union of this bounding box and another. | |
Resets the box to it's default empty state. | |
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.