CMSC23700 Common Code Library
Support code for CS23700 programming projects
Loading...
Searching...
No Matches
cs237::__detail::Plane< T > Struct Template Reference

representation of a oriented 3D plane More...

#include <cs237-plane.hpp>

Public Types

using vec3 = glm::vec< 3, T, glm::defaultp >
 
using vec4 = glm::vec< 4, T, glm::defaultp >
 

Public Member Functions

 Plane ()
 unit normal and signed distance from origin
 
 Plane (vec3 n, T d)
 specify a plane as a unit-length normal vector and signed distance from origin
 
 Plane (vec3 n, vec3 p)
 specify a plane as a normal vector and point on the plane
 
vec3 norm () const
 get the plane normal vector
 
T dist () const
 signed distance from origin to plane
 
T distanceToPt (vec3 const &p) const
 signed distance from a point to plane
 
vec3 project (vec3 const &p) const
 
std::string toString () const
 the string representation of a plane
 

Public Attributes

vec4 _nd
 

Detailed Description

template<typename T>
struct cs237::__detail::Plane< T >

representation of a oriented 3D plane

Member Typedef Documentation

◆ vec3

template<typename T >
using cs237::__detail::Plane< T >::vec3 = glm::vec<3, T, glm::defaultp>

◆ vec4

template<typename T >
using cs237::__detail::Plane< T >::vec4 = glm::vec<4, T, glm::defaultp>

Constructor & Destructor Documentation

◆ Plane() [1/3]

template<typename T >
cs237::__detail::Plane< T >::Plane ( )
inline

unit normal and signed distance from origin

◆ Plane() [2/3]

template<typename T >
cs237::__detail::Plane< T >::Plane ( vec3  n,
T  d 
)
inline

specify a plane as a unit-length normal vector and signed distance from origin

Parameters
nunit-length plane normal vector
dsigned distance from origin to the plane

◆ Plane() [3/3]

template<typename T >
cs237::__detail::Plane< T >::Plane ( vec3  n,
vec3  p 
)
inline

specify a plane as a normal vector and point on the plane

Parameters
nplane-normal vector (does not have to be unit length)
pa point on the plane

Member Function Documentation

◆ dist()

template<typename T >
T cs237::__detail::Plane< T >::dist ( ) const
inline

signed distance from origin to plane

◆ distanceToPt()

template<typename T >
T cs237::__detail::Plane< T >::distanceToPt ( vec3 const p) const
inline

signed distance from a point to plane

Parameters
pa point in space
Returns
the signed distance from p to the plane

◆ norm()

template<typename T >
vec3 cs237::__detail::Plane< T >::norm ( ) const
inline

get the plane normal vector

◆ project()

template<typename T >
vec3 cs237::__detail::Plane< T >::project ( vec3 const p) const
inline

project a point onto the plane

Parameters
pa point in space
Returns
the projection of the point p onto the plane.

◆ toString()

template<typename T >
std::string cs237::__detail::Plane< T >::toString ( ) const
inline

the string representation of a plane

Member Data Documentation

◆ _nd

template<typename T >
vec4 cs237::__detail::Plane< T >::_nd

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