NGL  6.5
The NCCA Graphics Library
ngl::Plane Class Reference

#include <Plane.h>

+ Collaboration diagram for ngl::Plane:

Public Member Functions

 Plane (const Vec3 &_v1, const Vec3 &_v2, const Vec3 &_v3) noexcept
 ctor passing in 3 vectors for the plane More...
 
 Plane () noexcept
 default ctor More...
 
 ~Plane () noexcept
 dtor (not used) More...
 
void setPoints (const Vec3 &_v1, const Vec3 &_v2, const Vec3 &_v3) noexcept
 set the plane from 3 points More...
 
void setNormalPoint (const Vec3 &_normal, const Vec3 &_point) noexcept
 set the plane from a normal and a point More...
 
void setFloats (Real _a, Real _b, Real _c, Real _d) noexcept
 set the plane from the co-efficients More...
 
Real distance (const Vec3 &_p) const noexcept
 get the distance from the point _p to the plane More...
 
Vec3 getNormal () const noexcept
 accesor to get the normal More...
 
Vec3 getPoint () const noexcept
 accesor to get the point More...
 
Real getD () const noexcept
 accesor to get D More...
 

Private Attributes

Vec3 m_normal
 the normal of the plane More...
 
Vec3 m_point
 the point position of the normal / plane More...
 
Real m_d
 the co-efficient of the plane More...
 

Detailed Description

Definition at line 41 of file Plane.h.

Constructor & Destructor Documentation

ngl::Plane::Plane ( const Vec3 _v1,
const Vec3 _v2,
const Vec3 _v3 
)
noexcept

ctor passing in 3 vectors for the plane

Parameters
[in]_v1the first Point
[in]_v2the second Point
[in]_v3the third Point

Definition at line 31 of file Plane.cpp.

References setPoints().

+ Here is the call graph for this function:

ngl::Plane::Plane ( )
noexcept

default ctor

Definition at line 26 of file Plane.cpp.

ngl::Plane::~Plane ( )
noexcept

dtor (not used)

Definition at line 37 of file Plane.cpp.

Member Function Documentation

Real ngl::Plane::distance ( const Vec3 _p) const
noexcept

get the distance from the point _p to the plane

Parameters
[in]_pthe position to check agains
Returns
the distance from point to plane

Definition at line 75 of file Plane.cpp.

References ngl::Vec3::inner(), m_d, and m_normal.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Real ngl::Plane::getD ( ) const
inlinenoexcept

accesor to get D

Returns
the m_d

Definition at line 104 of file Plane.h.

Vec3 ngl::Plane::getNormal ( ) const
inlinenoexcept

accesor to get the normal

Returns
the normal

Definition at line 93 of file Plane.h.

+ Here is the caller graph for this function:

Vec3 ngl::Plane::getPoint ( ) const
inlinenoexcept

accesor to get the point

Returns
the point

Definition at line 99 of file Plane.h.

void ngl::Plane::setFloats ( Real  _a,
Real  _b,
Real  _c,
Real  _d 
)
noexcept

set the plane from the co-efficients

Parameters
[in]_athe first co-efficient
[in]_bthe second co-efficient
[in]_cthe third co-efficient
[in]_dthe fourth co-efficient

Definition at line 62 of file Plane.cpp.

References ngl::Vec3::length(), m_d, m_normal, ngl::Vec3::normalize(), and ngl::Vec3::set().

+ Here is the call graph for this function:

void ngl::Plane::setNormalPoint ( const Vec3 _normal,
const Vec3 _point 
)
noexcept

set the plane from a normal and a point

Parameters
[in]_normalthe normal
[in]_pointthe point

Definition at line 54 of file Plane.cpp.

References ngl::Vec3::inner(), m_d, m_normal, m_point, and ngl::Vec3::normalize().

+ Here is the call graph for this function:

void ngl::Plane::setPoints ( const Vec3 _v1,
const Vec3 _v2,
const Vec3 _v3 
)
noexcept

set the plane from 3 points

Parameters
[in]_v1the first point
[in]_v2the second point
[in]_v3the third point

Definition at line 42 of file Plane.cpp.

References ngl::Vec3::cross(), ngl::Vec3::inner(), m_d, m_normal, m_point, and ngl::Vec3::normalize().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

Real ngl::Plane::m_d
private

the co-efficient of the plane

Definition at line 119 of file Plane.h.

Vec3 ngl::Plane::m_normal
private

the normal of the plane

Definition at line 111 of file Plane.h.

Vec3 ngl::Plane::m_point
private

the point position of the normal / plane

Definition at line 115 of file Plane.h.


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