HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Plane3< T > Class Template Reference

#include <ImathPlane.h>

Public Member Functions

Constructors
IMATH_HOSTDEVICE Plane3 () IMATH_NOEXCEPT
 Uninitialized by default. More...
 
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Plane3 (const Vec3< T > &normal, T distance) IMATH_NOEXCEPT
 Initialize with a normal and distance. More...
 
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Plane3 (const Vec3< T > &point, const Vec3< T > &normal) IMATH_NOEXCEPT
 Initialize with a point and a normal. More...
 
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Plane3 (const Vec3< T > &point1, const Vec3< T > &point2, const Vec3< T > &point3) IMATH_NOEXCEPT
 Initialize with three points. More...
 
Manipulation
IMATH_HOSTDEVICE void set (const Vec3< T > &normal, T distance) IMATH_NOEXCEPT
 Set via a given normal and distance. More...
 
IMATH_HOSTDEVICE void set (const Vec3< T > &point, const Vec3< T > &normal) IMATH_NOEXCEPT
 Set via a given point and normal. More...
 
IMATH_HOSTDEVICE void set (const Vec3< T > &point1, const Vec3< T > &point2, const Vec3< T > &point3) IMATH_NOEXCEPT
 Set via three points. More...
 
Utility Methods
IMATH_HOSTDEVICE
IMATH_CONSTEXPR14 bool 
intersect (const Line3< T > &line, Vec3< T > &intersection) const IMATH_NOEXCEPT
 
IMATH_HOSTDEVICE
IMATH_CONSTEXPR14 bool 
intersectT (const Line3< T > &line, T &parameter) const IMATH_NOEXCEPT
 
IMATH_HOSTDEVICE constexpr T distanceTo (const Vec3< T > &point) const IMATH_NOEXCEPT
 Return the distance from a point to the plane. More...
 
IMATH_HOSTDEVICE constexpr
Vec3< T
reflectPoint (const Vec3< T > &point) const IMATH_NOEXCEPT
 Reflect the given point around the plane. More...
 
IMATH_HOSTDEVICE constexpr
Vec3< T
reflectVector (const Vec3< T > &vec) const IMATH_NOEXCEPT
 Reflect the direction vector around the plane. More...
 

Public Attributes

Direct access to member fields
Vec3< Tnormal
 The normal to the plane. More...
 
T distance
 The distance from the origin to the plane. More...
 

Detailed Description

template<class T>
class Plane3< T >

The Plane3 class represents a half space in 3D, so the normal may point either towards or away from origin. The plane P can be represented by Plane3 as either p or -p corresponding to the two half-spaces on either side of the plane. Any function which computes a distance will return either negative or positive values for the distance indicating which half-space the point is in. Note that reflection, and intersection functions will operate as expected.

Definition at line 31 of file ImathPlane.h.

Constructor & Destructor Documentation

template<class T>
IMATH_HOSTDEVICE Plane3< T >::Plane3 ( )
inline

Uninitialized by default.

Definition at line 50 of file ImathPlane.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Plane3< T >::Plane3 ( const Vec3< T > &  normal,
T  distance 
)
inline

Initialize with a normal and distance.

Definition at line 124 of file ImathPlane.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Plane3< T >::Plane3 ( const Vec3< T > &  point,
const Vec3< T > &  normal 
)
inline

Initialize with a point and a normal.

Definition at line 130 of file ImathPlane.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Plane3< T >::Plane3 ( const Vec3< T > &  point1,
const Vec3< T > &  point2,
const Vec3< T > &  point3 
)
inline

Initialize with three points.

Definition at line 118 of file ImathPlane.h.

Member Function Documentation

template<class T >
IMATH_HOSTDEVICE constexpr T Plane3< T >::distanceTo ( const Vec3< T > &  point) const
inline

Return the distance from a point to the plane.

Definition at line 164 of file ImathPlane.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool Plane3< T >::intersect ( const Line3< T > &  line,
Vec3< T > &  intersection 
) const
inline

Determine if a line intersects the plane.

Parameters
lineThe line
[out]intersectionThe point of intersection
Returns
True if the line intersects the plane.

Definition at line 185 of file ImathPlane.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool Plane3< T >::intersectT ( const Line3< T > &  line,
T parameter 
) const
inline

Determine if a line intersects the plane.

Parameters
lineThe line
[out]parameterThe parametric value of the point of intersection
Returns
True if the line intersects the plane.

Definition at line 197 of file ImathPlane.h.

template<class T >
IMATH_HOSTDEVICE constexpr Vec3< T > Plane3< T >::reflectPoint ( const Vec3< T > &  point) const
inline

Reflect the given point around the plane.

Definition at line 171 of file ImathPlane.h.

template<class T >
IMATH_HOSTDEVICE constexpr Vec3< T > Plane3< T >::reflectVector ( const Vec3< T > &  vec) const
inline

Reflect the direction vector around the plane.

Definition at line 178 of file ImathPlane.h.

template<class T >
IMATH_HOSTDEVICE void Plane3< T >::set ( const Vec3< T > &  normal,
T  distance 
)
inline

Set via a given normal and distance.

Definition at line 155 of file ImathPlane.h.

template<class T >
IMATH_HOSTDEVICE void Plane3< T >::set ( const Vec3< T > &  point,
const Vec3< T > &  normal 
)
inline

Set via a given point and normal.

Definition at line 146 of file ImathPlane.h.

template<class T >
IMATH_HOSTDEVICE void Plane3< T >::set ( const Vec3< T > &  point1,
const Vec3< T > &  point2,
const Vec3< T > &  point3 
)
inline

Set via three points.

Definition at line 137 of file ImathPlane.h.

Member Data Documentation

template<class T>
T Plane3< T >::distance

The distance from the origin to the plane.

Definition at line 42 of file ImathPlane.h.

template<class T>
Vec3<T> Plane3< T >::normal

The normal to the plane.

Definition at line 39 of file ImathPlane.h.


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