Atoms Crowd  7.0.0
Plane3< T > Class Template Reference

#include <ImathPlane.h>

Public Member Functions

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

Public Attributes

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

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.

Member Function Documentation

◆ intersect()

template<class T >
ATOMSMATH_CONSTEXPR14 bool Plane3< T >::intersect ( const Line3< T > &  line,
Vec3< T > &  intersection 
) const
inlinenoexcept

Determine if a line intersects the plane.

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

◆ intersectT()

template<class T >
ATOMSMATH_CONSTEXPR14 bool Plane3< T >::intersectT ( const Line3< T > &  line,
T &  parameter 
) const
inlinenoexcept

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.

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