Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | Public Attributes | List of all members
jau::math::geom::Frustum::Plane Class Reference

Plane equation := dot(n, x - p) = 0 -> Ax + By + Cz + d == 0. More...

#include <frustum.hpp>

Collaboration diagram for jau::math::geom::Frustum::Plane:

Public Member Functions

constexpr Plane () noexcept
 
constexpr Plane (const Plane &o) noexcept=default
 
constexpr Plane (Plane &&o) noexcept=default
 
constexpr float distanceTo (const float x, const float y, const float z) const noexcept
 Return signed distance of plane to given point. More...
 
constexpr float distanceTo (const jau::math::Vec3f &p) const noexcept
 Return distance of plane to given point, see distanceTo(float, float, float). More...
 
constexpr Planeoperator= (const Plane &) noexcept=default
 
constexpr Planeoperator= (Plane &&) noexcept=default
 
constexpr Planeset (const jau::math::Vec3f &n_, const jau::math::Vec3f &p0) noexcept
 Setup of plane using given normal and one point on plane. More...
 
constexpr Planeset (const jau::math::Vec3f &p0, const jau::math::Vec3f &p1, const jau::math::Vec3f &p2) noexcept
 Setup of plane using 3 points. More...
 
constexpr void toFloats (float out[]) const noexcept
 Sets the given [float[off]..float[off+4]) out to ( n, d ). More...
 
std::string toString () const noexcept
 
constexpr jau::math::Vec4ftoVec4f (jau::math::Vec4f &out) const noexcept
 Sets the given vec4f out to ( n, d ). More...
 

Public Attributes

float d
 Distance to origin. More...
 
jau::math::Vec3f n
 Normal of the plane. More...
 

Detailed Description

Plane equation := dot(n, x - p) = 0 -> Ax + By + Cz + d == 0.

In order to work w/ isOutside(..) methods, the normals have to point to the inside of the frustum.

Definition at line 151 of file frustum.hpp.

Constructor & Destructor Documentation

◆ Plane() [1/3]

constexpr jau::math::geom::Frustum::Plane::Plane ( )
inlineconstexprnoexcept

Definition at line 159 of file frustum.hpp.

◆ Plane() [2/3]

constexpr jau::math::geom::Frustum::Plane::Plane ( const Plane o)
constexprdefaultnoexcept

◆ Plane() [3/3]

constexpr jau::math::geom::Frustum::Plane::Plane ( Plane &&  o)
constexprdefaultnoexcept

Member Function Documentation

◆ operator=() [1/2]

constexpr Plane & jau::math::geom::Frustum::Plane::operator= ( const Plane )
constexprdefaultnoexcept

◆ operator=() [2/2]

constexpr Plane & jau::math::geom::Frustum::Plane::operator= ( Plane &&  )
constexprdefaultnoexcept

◆ set() [1/2]

constexpr Plane & jau::math::geom::Frustum::Plane::set ( const jau::math::Vec3f p0,
const jau::math::Vec3f p1,
const jau::math::Vec3f p2 
)
inlineconstexprnoexcept

Setup of plane using 3 points.

None of the three points are mutated.

Since this method may not properly define whether the normal points inside the frustum, consider using set(Vec3f, Vec3f).

Parameters
p0point on plane, used as the shared start-point for vec(p0->p1) and vec(p0->p2)
p1point on plane
p2point on plane
Returns
this plane for chaining

Definition at line 178 of file frustum.hpp.

◆ set() [2/2]

constexpr Plane & jau::math::geom::Frustum::Plane::set ( const jau::math::Vec3f n_,
const jau::math::Vec3f p0 
)
inlineconstexprnoexcept

Setup of plane using given normal and one point on plane.

The given normal is mutated, the point not mutated.

Parameters
n_normal to plane pointing to the inside of this frustum
p0point on plane, consider choosing the closest point to origin
Returns
this plane for chaining

Definition at line 192 of file frustum.hpp.

◆ toVec4f()

constexpr jau::math::Vec4f & jau::math::geom::Frustum::Plane::toVec4f ( jau::math::Vec4f out) const
inlineconstexprnoexcept

Sets the given vec4f out to ( n, d ).

Returns out for chaining.

Definition at line 199 of file frustum.hpp.

Here is the caller graph for this function:

◆ toFloats()

constexpr void jau::math::geom::Frustum::Plane::toFloats ( float  out[]) const
inlineconstexprnoexcept

Sets the given [float[off]..float[off+4]) out to ( n, d ).

Parameters
outthe float[off+4] output array

Definition at line 208 of file frustum.hpp.

◆ distanceTo() [1/2]

constexpr float jau::math::geom::Frustum::Plane::distanceTo ( const float  x,
const float  y,
const float  z 
) const
inlineconstexprnoexcept

Return signed distance of plane to given point.

  • If dist < 0 , then the point p lies in the negative halfspace.
  • If dist = 0 , then the point p lies in the plane.
  • If dist > 0 , then the point p lies in the positive halfspace.

A plane cuts 3D space into 2 half spaces.

Positive halfspace is where the plane’s normals vector points into.

Negative halfspace is the other side of the plane, i.e. *-1

Definition at line 230 of file frustum.hpp.

◆ distanceTo() [2/2]

constexpr float jau::math::geom::Frustum::Plane::distanceTo ( const jau::math::Vec3f p) const
inlineconstexprnoexcept

Return distance of plane to given point, see distanceTo(float, float, float).

Definition at line 235 of file frustum.hpp.

◆ toString()

std::string jau::math::geom::Frustum::Plane::toString ( ) const
inlinenoexcept

Definition at line 239 of file frustum.hpp.

Member Data Documentation

◆ n

jau::math::Vec3f jau::math::geom::Frustum::Plane::n

Normal of the plane.

Definition at line 154 of file frustum.hpp.

◆ d

float jau::math::geom::Frustum::Plane::d

Distance to origin.

Definition at line 157 of file frustum.hpp.


The documentation for this class was generated from the following file: