struct TConvexVolume

template<typename T>

Represents a convex volume defined by planes representing the volume border.

Public

Constructors

TConvexVolume<T>

TConvexVolume<T>() = default

TConvexVolume<T>

TConvexVolume<T>(const Vector<TPlane<T>> &planes)

TConvexVolume<T>

TConvexVolume<T>(const TMatrix4<T> &projectionMatrix, bool useNearPlane = true)

Creates frustum planes from the provided projection matrix.

Methods

Intersects

bool Intersects(const TAABox<T> &box) const

Checks does the volume intersects the provided axis aligned box.

This will return true if the box is fully inside the volume.

Intersects

bool Intersects(const TSphere<T> &sphere) const

Checks does the volume intersects the provided sphere.

This will return true if the sphere is fully inside the volume.

Contains

bool Contains(const TVector3<T> &p, T expand = (T)0.) const

Checks if the convex volume contains the provided point.

p
Point to check.
expand
Optional value to expand the size of the convex volume by the specified value during the check. Negative values shrink the volume.

GetPlanes

Vector<TPlane<T>> GetPlanes() const

Returns the internal set of planes that represent the volume.

GetPlane

const TPlane<T> &GetPlane(FrustumPlane whichPlane) const

Returns the specified plane that represents the volume.

Private

Fields

mPlanes

Vector<TPlane<T>> mPlanes