Ocean
|
This class implements a (possibly truncated) 3D cone. More...
Public Member Functions | |
ConeT3 ()=default | |
Creates an invalid cone. More... | |
ConeT3 (const VectorT3< T > &apex, const VectorT3< T > &axis, const T apexAngle, const T minSignedDistanceAlongAxis=T(0.0), const T maxSignedDistanceAlongAxis=std::numeric_limits< T >::infinity()) | |
Defines a new cone. More... | |
const VectorT3< T > & | apex () const |
Returns the tip of the cone. More... | |
const VectorT3< T > & | axis () const |
Returns the unit-length axis of the cone. More... | |
T | apexAngle () const |
Returns the angle made between diametrically opposite points on the cone and the apex. More... | |
const T & | minSignedDistanceAlongAxis () const |
Returns the minimum signed truncation distance along the cone's axis. More... | |
const T & | maxSignedDistanceAlongAxis () const |
Returns the maximum signed truncation distance along the cone's axis. More... | |
bool | nearestIntersection (const LineT3< T > &ray, VectorT3< T > &point) const |
Returns the closest point of intersection of a ray with the outer surface of the cone, ignoring intersections with the cone's base and intersections that 1) exit the cone or 2) are a negative signed distance along the ray. More... | |
bool | isValid () const |
Returns whether this cone is valid. More... | |
Protected Attributes | |
VectorT3< T > | apex_ = VectorT3<T>(T(0), T(0), T(0)) |
Cone tip. More... | |
VectorT3< T > | axis_ = VectorT3<T>(T(0), T(0), T(0)) |
Cone axis, a unit vector. More... | |
T | cosSquaredHalfApexAngle_ = T(0) |
Cosine-squared of half of the cone's apex angle. More... | |
T | minSignedDistanceAlongAxis_ = T(0) |
Minimum signed truncation distance along the cone's axis. More... | |
T | maxSignedDistanceAlongAxis_ = T(0) |
Maximum signed truncation distance along the cone's axis. More... | |
This class implements a (possibly truncated) 3D cone.
|
default |
Creates an invalid cone.
|
inline |
Defines a new cone.
apex | 3D coordinate for the tip of the cone |
axis | Direction vector of the cone's axis, expected to already be normalized to unit length |
apexAngle | Angle in radians formed at the apex by any vertical slice of the cone through its apex, must be in (0, pi) |
minSignedDistanceAlongAxis | For a truncated cone, the minimum signed distance along the cone's axis at which the cones stops, defaults to the apex of the cone (distance = 0); for an infinite cone, set the minimum radius to -infinity |
maxSignedDistanceAlongAxis | For a truncated cone, the maximum signed distance along the cone's axis at which the cone stops; note that only horizontal slices (perpendicular to its axis) through the cone are supported |
|
inline |
Returns the tip of the cone.
|
inline |
Returns the angle made between diametrically opposite points on the cone and the apex.
|
inline |
Returns the unit-length axis of the cone.
|
inline |
Returns whether this cone is valid.
|
inline |
Returns the maximum signed truncation distance along the cone's axis.
|
inline |
Returns the minimum signed truncation distance along the cone's axis.
If the cone ends at its apex, the value is zero; otherwise, the value is simply less than maxSignedDistanceAlongAxis.
bool Ocean::ConeT3< T >::nearestIntersection | ( | const LineT3< T > & | ray, |
VectorT3< T > & | point | ||
) | const |
Returns the closest point of intersection of a ray with the outer surface of the cone, ignoring intersections with the cone's base and intersections that 1) exit the cone or 2) are a negative signed distance along the ray.
ray | Ray for which to find the intersection, must be valid |
point | Output 3D point of intersection |
|
protected |
Cone tip.
|
protected |
Cone axis, a unit vector.
|
protected |
Cosine-squared of half of the cone's apex angle.
|
protected |
Maximum signed truncation distance along the cone's axis.
|
protected |
Minimum signed truncation distance along the cone's axis.