AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agx::PlaneT< T > Class Template Reference

Class representing the mathematical concept of a plane, also called a half- space. More...

#include <Plane.h>

Public Member Functions

 PlaneT ()
 Create a plane with it surface on the X and Y axes.
 
 PlaneT (const agx::Vec3T< T > &normal, const agx::Vec3T< T > &point)
 Constructor.
 
 PlaneT (const agx::Vec3T< T > &normal, const T d)
 Constructor.
 
 PlaneT (const agx::Vec3T< T > &p1, const agx::Vec3T< T > &p2, const agx::Vec3T< T > &p3)
 Constructor.
 
 PlaneT (const agx::Vec4T< T > &plane)
 Create a plane from a Vec4T.
 
 PlaneT (const T a, const T b, const T c, const T d)
 a, b, and c forms the normal of the plane and d is the distance from the origin.
 
PlaneT calculatePlane (const agx::AffineMatrix4x4 &transform) const
 Create a new plane that is equal to the current plane transformed by the given transform.
 
PlaneT calculateTransformedPlane (const agx::AffineMatrix4x4 &transform) const
 Create a new plane that is equal to the current plane transformed by the given transform.
 
T getDistance () const
 
agx::Vec3T< T > getNormal () const
 
 operator agx::Vec4T< T > () const
 Cast to Vec4.
 
agx::Vec3T< T > project (const agx::Vec3T< T > &point) const
 Projects the point point onto this plane.
 
void set (const agx::PlaneT< T > &plane)
 Make this plane a copy of the given plane.
 
void set (const agx::Vec4T< T > &plane)
 Reconfigure this plane according the given specification.
 
void setDistance (const T distance)
 Translate the plane parallel to the normal so that the given distance becomes the new distance from the origin.
 
void setNormal (const agx::Vec3T< T > &normal)
 Change the orientation of the plane so that the given normal becomes the new normal of the plane.
 
T signedDistanceToPoint (const agx::Vec3T< T > &point) const
 Calculates the distance from the plane to a point.
 

Detailed Description

template<typename T>
class agx::PlaneT< T >

Class representing the mathematical concept of a plane, also called a half- space.

Not to be confused with the geometrical shape Plane defined in agxCollide.

Definition at line 31 of file agx/Plane.h.

Constructor & Destructor Documentation

◆ PlaneT() [1/6]

template<typename T >
agx::PlaneT< T >::PlaneT

Create a plane with it surface on the X and Y axes.

Definition at line 139 of file agx/Plane.h.

References agx::init().

◆ PlaneT() [2/6]

template<typename T >
agx::PlaneT< T >::PlaneT ( const agx::Vec4T< T > &  plane)

Create a plane from a Vec4T.

The first three elements become the normal and the last element is the distance from the origin to the newly created plane.

Definition at line 145 of file agx/Plane.h.

◆ PlaneT() [3/6]

template<typename T >
agx::PlaneT< T >::PlaneT ( const T  a,
const T  b,
const T  c,
const T  d 
)

a, b, and c forms the normal of the plane and d is the distance from the origin.

ax+by+cz+d=0

Definition at line 149 of file agx/Plane.h.

References agx::init().

◆ PlaneT() [4/6]

template<typename T >
agx::PlaneT< T >::PlaneT ( const agx::Vec3T< T > &  normal,
const T  d 
)

Constructor.

Parameters
normalPlane normal (a,b,c) in plane equation.
dDistance from origin.

Definition at line 155 of file agx/Plane.h.

References agx::init().

◆ PlaneT() [5/6]

template<typename T >
agx::PlaneT< T >::PlaneT ( const agx::Vec3T< T > &  normal,
const agx::Vec3T< T > &  point 
)

Constructor.

Parameters
normal- Normal (a,b,c) in the plane equation
point- A point on the plane

Definition at line 161 of file agx/Plane.h.

References agx::init().

◆ PlaneT() [6/6]

template<typename T >
agx::PlaneT< T >::PlaneT ( const agx::Vec3T< T > &  p1,
const agx::Vec3T< T > &  p2,
const agx::Vec3T< T > &  p3 
)

Constructor.

Plane defined by three points in space.

Definition at line 168 of file agx/Plane.h.

References agx::init(), and agx::Vec3T< T >::normalize().

Member Function Documentation

◆ calculatePlane()

template<typename T >
PlaneT< T > agx::PlaneT< T >::calculatePlane ( const agx::AffineMatrix4x4 &  transform) const

Create a new plane that is equal to the current plane transformed by the given transform.

Definition at line 221 of file agx/Plane.h.

◆ calculateTransformedPlane()

template<typename T >
PlaneT< T > agx::PlaneT< T >::calculateTransformedPlane ( const agx::AffineMatrix4x4 &  transform) const

Create a new plane that is equal to the current plane transformed by the given transform.

Definition at line 239 of file agx/Plane.h.

◆ getDistance()

template<typename T >
T agx::PlaneT< T >::getDistance
Returns
The shortest distance from the origin to the plan.

Definition at line 194 of file agx/Plane.h.

Referenced by agxCollide::Plane::getDistance(), agx::operator<<(), and agx::PlaneT< T >::set().

◆ getNormal()

template<typename T >
Vec3T< T > agx::PlaneT< T >::getNormal
Returns
The normal of the plane.

Definition at line 191 of file agx/Plane.h.

Referenced by agxCollide::Plane::getNormal(), agx::operator<<(), and agx::PlaneT< T >::set().

◆ operator agx::Vec4T< T >()

template<typename T >
agx::PlaneT< T >::operator agx::Vec4T< T > ( ) const

Cast to Vec4.

The first three elements of the returned Vec4T hold the normal and the last element holds the distance.

◆ project()

template<typename T >
Vec3T< T > agx::PlaneT< T >::project ( const agx::Vec3T< T > &  point) const

Projects the point point onto this plane.

Parameters
point- point to project onto this plane
Returns
point in plane

Definition at line 215 of file agx/Plane.h.

◆ set() [1/2]

template<typename T >
void agx::PlaneT< T >::set ( const agx::PlaneT< T > &  plane)

Make this plane a copy of the given plane.

Definition at line 206 of file agx/Plane.h.

References agx::PlaneT< T >::getDistance(), agx::PlaneT< T >::getNormal(), and agx::init().

◆ set() [2/2]

template<typename T >
void agx::PlaneT< T >::set ( const agx::Vec4T< T > &  plane)

Reconfigure this plane according the given specification.

The first three elements of the Vec4 are taken to be the normal and the last element becomes the distance from the origin.

Definition at line 203 of file agx/Plane.h.

References agx::init().

◆ setDistance()

template<typename T >
void agx::PlaneT< T >::setDistance ( const T  distance)

Translate the plane parallel to the normal so that the given distance becomes the new distance from the origin.

Definition at line 200 of file agx/Plane.h.

◆ setNormal()

template<typename T >
void agx::PlaneT< T >::setNormal ( const agx::Vec3T< T > &  normal)

Change the orientation of the plane so that the given normal becomes the new normal of the plane.

Definition at line 197 of file agx/Plane.h.

◆ signedDistanceToPoint()

template<typename T >
T agx::PlaneT< T >::signedDistanceToPoint ( const agx::Vec3T< T > &  point) const

Calculates the distance from the plane to a point.

Negative value if the point is behind the plane, otherwise positive.

Definition at line 209 of file agx/Plane.h.


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