struct TPlane

template<typename T>

A plane represented by a normal and a distance.

Public

Constructors

TPlane<T>

TPlane<T>()

TPlane<T>

TPlane<T>(const TPlane<T> &copy) = default

TPlane<T>

TPlane<T>(const TVector3<T> &normal, T d)

TPlane<T>

TPlane<T>(T a, T b, T c, T d)

TPlane<T>

TPlane<T>(const TVector3<T> &normal, const TVector3<T> &point)

TPlane<T>

TPlane<T>(const TVector3<T> &point0, const TVector3<T> &point1, const TVector3<T> &point2)

TPlane

TPlane()

TPlane

TPlane(const TPlane<float> &copy) = default

TPlane

TPlane(const TVector3<float> &normal, float d)

TPlane

TPlane(float a, float b, float c, float d)

TPlane

TPlane(const TVector3<float> &normal, const TVector3<float> &point)

TPlane

TPlane(const TVector3<float> &point0, const TVector3<float> &point1, const TVector3<float> &point2)

TPlane

TPlane()

TPlane

TPlane(const TPlane<double> &copy) = default

TPlane

TPlane(const TVector3<double> &normal, double d)

TPlane

TPlane(double a, double b, double c, double d)

TPlane

TPlane(const TVector3<double> &normal, const TVector3<double> &point)

TPlane

TPlane(const TVector3<double> &point0, const TVector3<double> &point1, const TVector3<double> &point2)

Methods

GetSide

PlaneSide GetSide(const TVector3<T> &point, T epsilon = (T)0.) const

Returns the side of the plane where the point is located on.

GetSide

PlaneSide GetSide(const TAABox<T> &box) const

Returns the side where the alignedBox is.

The flag BOTH_SIDE indicates an intersecting box. One corner ON the plane is sufficient to consider the box and the plane intersecting.

GetSide

PlaneSide GetSide(const TSphere<T> &sphere) const

Returns the side where the sphere is.

The flag BOTH_SIDE indicates an intersecting sphere.

GetDistance

T GetDistance(const TVector3<T> &point) const

Returns a distance from point to plane.

ProjectVector

TVector3<T> ProjectVector(const TVector3<T> &v) const

Project a vector onto the plane.

Normalize

T Normalize()

Normalizes the plane's normal and the length scale of d.

Intersects

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

Box/plane intersection.

Intersects

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

Sphere/plane intersection.

Intersects

std::pair<bool, T> Intersects(const TRay<T> &ray) const

Ray/plane intersection, returns boolean result and distance to intersection point.

GetSide

PlaneSide GetSide(const TVector3<float> &point, float epsilon) const

Returns the side of the plane where the point is located on.

GetSide

PlaneSide GetSide(const TAABox<float> &box) const

Returns the side where the alignedBox is.

The flag BOTH_SIDE indicates an intersecting box. One corner ON the plane is sufficient to consider the box and the plane intersecting.

GetSide

PlaneSide GetSide(const TSphere<float> &sphere) const

Returns the side where the sphere is.

The flag BOTH_SIDE indicates an intersecting sphere.

GetDistance

float GetDistance(const TVector3<float> &point) const

Returns a distance from point to plane.

ProjectVector

TVector3<float> ProjectVector(const TVector3<float> &v) const

Project a vector onto the plane.

Normalize

float Normalize()

Normalizes the plane's normal and the length scale of d.

Intersects

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

Box/plane intersection.

Intersects

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

Sphere/plane intersection.

Intersects

std::pair<bool, float> Intersects(const TRay<float> &ray) const

Ray/plane intersection, returns boolean result and distance to intersection point.

GetSide

PlaneSide GetSide(const TVector3<double> &point, double epsilon) const

Returns the side of the plane where the point is located on.

GetSide

PlaneSide GetSide(const TAABox<double> &box) const

Returns the side where the alignedBox is.

The flag BOTH_SIDE indicates an intersecting box. One corner ON the plane is sufficient to consider the box and the plane intersecting.

GetSide

PlaneSide GetSide(const TSphere<double> &sphere) const

Returns the side where the sphere is.

The flag BOTH_SIDE indicates an intersecting sphere.

GetDistance

double GetDistance(const TVector3<double> &point) const

Returns a distance from point to plane.

ProjectVector

TVector3<double> ProjectVector(const TVector3<double> &v) const

Project a vector onto the plane.

Normalize

double Normalize()

Normalizes the plane's normal and the length scale of d.

Intersects

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

Box/plane intersection.

Intersects

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

Sphere/plane intersection.

Intersects

std::pair<bool, double> Intersects(const TRay<double> &ray) const

Ray/plane intersection, returns boolean result and distance to intersection point.

Fields

Normal

TVector3<T> Normal

D

T D

Normal

TVector3<float> Normal

D

float D

Normal

TVector3<double> Normal

D

double D

Operators

operator=

TPlane<T> &operator=(const TPlane<T> &rhs) = default

operator==

bool operator==(const TPlane<T> &rhs) const

operator!=

bool operator!=(const TPlane<T> &rhs) const

operator=

TPlane<float> &operator=(const TPlane<float> &rhs) = default

operator==

bool operator==(const TPlane<float> &rhs) const

operator!=

bool operator!=(const TPlane<float> &rhs) const

operator=

TPlane<double> &operator=(const TPlane<double> &rhs) = default

operator==

bool operator==(const TPlane<double> &rhs) const

operator!=

bool operator!=(const TPlane<double> &rhs) const