Loading...
Searching...
No Matches
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T > Class Template Reference

A plane and related functions. More...

#include <ignition/math/Plane.hh>

Public Types

enum  PlaneSide { NEGATIVE_SIDE = 0 , POSITIVE_SIDE = 1 , NO_SIDE = 2 , BOTH_SIDE = 3 }
 Enum used to indicate a side of the plane, no side, or both sides for entities on the plane. More...
 

Public Member Functions

 Plane ()
 Constructor.
 
 Plane (const Vector3< T > &_normal, const Vector2< T > &_size, T _offset)
 Constructor.
 
 Plane (const Vector3< T > &_normal, T _offset=0.0)
 Constructor from a normal and a distance.
 
virtual ~Plane ()
 Destructor.
 
Distance (const Vector3< T > &_origin, const Vector3< T > &_dir) const
 Get distance to the plane give an origin and direction.
 
Distance (const Vector3< T > &_point) const
 The distance to the plane from the given point.
 
Vector3< T > & Normal ()
 Get the plane offset.
 
const Vector3< T > & Normal () const
 Get the plane offset.
 
Offset () const
 Get the plane offset.
 
Plane< T > & operator= (const Plane< T > &_p)
 Equal operator.
 
void Set (const Vector3< T > &_normal, const Vector2< T > &_size, T _offset)
 Set the plane.
 
void Set (const Vector3< T > &_normal, T _offset)
 Set the plane.
 
PlaneSide Side (const math::Box &_box) const
 The side of the plane a box is on.
 
PlaneSide Side (const Vector3< T > &_point) const
 The side of the plane a point is on.
 
Vector2< T > & Size ()
 Get the plane size.
 
const Vector2< T > & Size () const
 Get the plane size.
 

Detailed Description

template<typename T>
class ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >

A plane and related functions.

Member Enumeration Documentation

◆ PlaneSide

Enum used to indicate a side of the plane, no side, or both sides for entities on the plane.

See also
Side
Enumerator
NEGATIVE_SIDE 

Negative side of the plane.

This is the side that is opposite the normal.

POSITIVE_SIDE 

Positive side of the plane.

This is the side that has the normal vector.

NO_SIDE 

On the plane.

BOTH_SIDE 

On both sides of the plane.

Constructor & Destructor Documentation

◆ Plane() [1/3]

template<typename T >
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Plane ( )
inline

Constructor.

◆ Plane() [2/3]

template<typename T >
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Plane ( const Vector3< T > & _normal,
T _offset = 0.0 )
inline

Constructor from a normal and a distance.

Parameters
[in]_normalThe plane normal
[in]_offsetOffset along the normal

◆ Plane() [3/3]

template<typename T >
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Plane ( const Vector3< T > & _normal,
const Vector2< T > & _size,
T _offset )
inline

Constructor.

Parameters
[in]_normalThe plane normal
[in]_sizeSize of the plane
[in]_offsetOffset along the normal

References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Set().

◆ ~Plane()

template<typename T >
virtual ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::~Plane ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ Distance() [1/2]

template<typename T >
T ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Distance ( const Vector3< T > & _origin,
const Vector3< T > & _dir ) const
inline

Get distance to the plane give an origin and direction.

Parameters
[in]_originthe origin
[in]_dira direction
Returns
the shortest distance

References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Vector3< T >::Dot().

◆ Distance() [2/2]

template<typename T >
T ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Distance ( const Vector3< T > & _point) const
inline

The distance to the plane from the given point.

The distance can be negative, which indicates the point is on the negative side of the plane.

Parameters
[in]_point3D point to calculate distance from.
Returns
Distance from the point to the plane.
See also
Side

Referenced by ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Side(), and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Side().

◆ Normal() [1/2]

template<typename T >
Vector3< T > & ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Normal ( )
inline

Get the plane offset.

◆ Normal() [2/2]

template<typename T >
const Vector3< T > & ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Normal ( ) const
inline

Get the plane offset.

◆ Offset()

template<typename T >
T ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Offset ( ) const
inline

Get the plane offset.

◆ operator=()

template<typename T >
Plane< T > & ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::operator= ( const Plane< T > & _p)
inline

Equal operator.

Parameters
_panother plane
Returns
itself

◆ Set() [1/2]

template<typename T >
void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Set ( const Vector3< T > & _normal,
const Vector2< T > & _size,
T _offset )
inline

Set the plane.

Parameters
[in]_normalThe plane normal
[in]_sizeSize of the plane
[in]_offsetOffset along the normal

◆ Set() [2/2]

template<typename T >
void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Set ( const Vector3< T > & _normal,
T _offset )
inline

Set the plane.

Parameters
[in]_normalThe plane normal
[in]_offsetOffset along the normal

Referenced by ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Plane().

◆ Side() [1/2]

◆ Side() [2/2]

template<typename T >
PlaneSide ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Side ( const Vector3< T > & _point) const
inline

The side of the plane a point is on.

Parameters
[in]_pointThe 3D point to check.
Returns
Plane::NEGATIVE_SIDE if the distance from the point to the plane is negative, Plane::POSITIVE_SIDE if the distance from the point to the plane is positive, or Plane::NO_SIDE if the point is on the plane.

References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Distance(), ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::NEGATIVE_SIDE, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::NO_SIDE, and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::POSITIVE_SIDE.

◆ Size() [1/2]

template<typename T >
Vector2< T > & ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Size ( )
inline

Get the plane size.

◆ Size() [2/2]

template<typename T >
const Vector2< T > & ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Plane< T >::Size ( ) const
inline

Get the plane size.


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