Antkeeper  0.0.1
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
geom::plane< T > Struct Template Reference

A flat 2-dimensional surface. More...

#include <plane.hpp>

Public Types

typedef math::vector< T, 3 > vector_type
 

Public Member Functions

 plane (const vector_type &normal, T distance)
 Creates a plane given a normal vector and distance. More...
 
 plane (const vector_type &normal, const vector_type &offset)
 Creates a plane given a normal vector and offset vector. More...
 
 plane (const vector_type &a, const vector_type &b, const vector_type &c)
 Creates a plane given three points. More...
 
 plane (const math::vector< T, 4 > &coefficients)
 Creates a plane given its coefficients. More...
 
 plane ()=default
 Creates an uninitialized plane. More...
 
signed_distance (const vector_type &v) const
 Calculates the signed distance between a plane and a vector. More...
 

Static Public Member Functions

static vector_type intersection (const plane &p0, const plane &p1, const plane &p2)
 Calculates the point of intersection between three planes. More...
 

Public Attributes

vector_type normal
 Plane normal vector. More...
 
distance
 Plane distance. More...
 

Detailed Description

template<class T>
struct geom::plane< T >

A flat 2-dimensional surface.

Definition at line 31 of file plane.hpp.

Member Typedef Documentation

◆ vector_type

template<class T >
typedef math::vector<T, 3> geom::plane< T >::vector_type

Definition at line 33 of file plane.hpp.

Constructor & Destructor Documentation

◆ plane() [1/5]

template<class T >
geom::plane< T >::plane ( const vector_type normal,
distance 
)
inline

Creates a plane given a normal vector and distance.

Definition at line 81 of file plane.hpp.

◆ plane() [2/5]

template<class T >
geom::plane< T >::plane ( const vector_type normal,
const vector_type offset 
)

Creates a plane given a normal vector and offset vector.

Definition at line 87 of file plane.hpp.

◆ plane() [3/5]

template<class T >
geom::plane< T >::plane ( const vector_type a,
const vector_type b,
const vector_type c 
)

Creates a plane given three points.

Definition at line 93 of file plane.hpp.

◆ plane() [4/5]

template<class T >
geom::plane< T >::plane ( const math::vector< T, 4 > &  coefficients)
explicit

Creates a plane given its coefficients.

Parameters
coefficientsVector containing the plane coefficients, A, B, C and D, as x, y, z, and w, respectively.

Definition at line 100 of file plane.hpp.

◆ plane() [5/5]

template<class T >
geom::plane< T >::plane ( )
default

Creates an uninitialized plane.

Member Function Documentation

◆ intersection()

template<class T >
plane< T >::vector_type geom::plane< T >::intersection ( const plane< T > &  p0,
const plane< T > &  p1,
const plane< T > &  p2 
)
static

Calculates the point of intersection between three planes.

Definition at line 116 of file plane.hpp.

◆ signed_distance()

template<class T >
T geom::plane< T >::signed_distance ( const vector_type v) const
inline

Calculates the signed distance between a plane and a vector.

Parameters
vVector.
Returns
Signed distance between the plane and vector.

Definition at line 110 of file plane.hpp.

Member Data Documentation

◆ distance

template<class T >
T geom::plane< T >::distance

Plane distance.

Definition at line 39 of file plane.hpp.

◆ normal

template<class T >
vector_type geom::plane< T >::normal

Plane normal vector.

Definition at line 36 of file plane.hpp.


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