Mathter
A configurable 3D math library for game developers.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
mathter::Line< T, Dim > Class Template Reference

#include <Geometry.hpp>

+ Inheritance diagram for mathter::Line< T, Dim >:

Public Member Functions

 Line ()=default
 Does not zero-initialize members. More...
 
 Line (const VectorT &base, const VectorT &direction)
 Construct a line through base in given direction . More...
 
 Line (const Hyperplane< T, 2 > &plane)
 A 2D plane and line are equivalent, converts representation. Only for 2D. More...
 
VectorT Direction () const
 Return the signed direction of the line (as given in constructor). More...
 
VectorT Base () const
 Returns the base point or point1 as given in constructor. More...
 
VectorT PointAt (T param) const
 Returns the point at param distance from the base point along direction. More...
 

Static Public Member Functions

static Line Through (const VectorT &point1, const VectorT &point2)
 Constructs a line through both points. More...
 

Public Attributes

VectorT direction
 
VectorT base
 

Constructor & Destructor Documentation

◆ Line() [1/3]

template<class T, int Dim>
mathter::Line< T, Dim >::Line ( )
default

Does not zero-initialize members.

◆ Line() [2/3]

template<class T, int Dim>
mathter::Line< T, Dim >::Line ( const VectorT base,
const VectorT direction 
)
inline

Construct a line through base in given direction .

Parameters
baseAny point in 3D space.
directionMust be normalized.

◆ Line() [3/3]

template<class T, int Dim>
mathter::Line< T, Dim >::Line ( const Hyperplane< T, 2 > &  plane)

A 2D plane and line are equivalent, converts representation. Only for 2D.

Member Function Documentation

◆ Base()

template<class T, int Dim>
VectorT mathter::Line< T, Dim >::Base ( ) const
inline

Returns the base point or point1 as given in constructor.

◆ Direction()

template<class T, int Dim>
VectorT mathter::Line< T, Dim >::Direction ( ) const
inline

Return the signed direction of the line (as given in constructor).

◆ PointAt()

template<class T, int Dim>
VectorT mathter::Line< T, Dim >::PointAt ( param) const
inline

Returns the point at param distance from the base point along direction.

◆ Through()

template<class T, int Dim>
static Line mathter::Line< T, Dim >::Through ( const VectorT point1,
const VectorT point2 
)
inlinestatic

Constructs a line through both points.

Parameters
point1Base of the line.
point2Specifies direction only.

Member Data Documentation

◆ base

template<class T, int Dim>
VectorT mathter::Line< T, Dim >::base

◆ direction

template<class T, int Dim>
VectorT mathter::Line< T, Dim >::direction

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