10 #ifndef INCLUDED_ATOMSMATHFRUSTUM_H
11 #define INCLUDED_ATOMSMATHFRUSTUM_H
13 #include <AtomsMath/ImathFun.h>
14 #include <AtomsMath/ImathLine.h>
15 #include <AtomsMath/ImathMatrix.h>
16 #include <AtomsMath/ImathNamespace.h>
17 #include <AtomsMath/ImathPlane.h>
18 #include <AtomsMath/ImathVec.h>
20 ATOMSMATH_INTERNAL_NAMESPACE_HEADER_ENTER
47 ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14
Frustum() noexcept;
50 ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14
Frustum (
const Frustum&) noexcept;
53 ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14
82 ATOMSMATH_HOSTDEVICE constexpr
bool orthographic() const noexcept {
return _orthographic; }
85 ATOMSMATH_HOSTDEVICE constexpr T
nearPlane() const noexcept {
return _nearPlane; }
88 ATOMSMATH_HOSTDEVICE constexpr T
hither() const noexcept {
return _nearPlane; }
91 ATOMSMATH_HOSTDEVICE constexpr T
farPlane() const noexcept {
return _farPlane; }
94 ATOMSMATH_HOSTDEVICE constexpr T
yon() const noexcept {
return _farPlane; }
97 ATOMSMATH_HOSTDEVICE constexpr T
left() const noexcept {
return _left; }
100 ATOMSMATH_HOSTDEVICE constexpr T
right() const noexcept {
return _right; }
103 ATOMSMATH_HOSTDEVICE constexpr T
bottom() const noexcept {
return _bottom; }
106 ATOMSMATH_HOSTDEVICE constexpr T
top() const noexcept {
return _top; }
109 ATOMSMATH_HOSTDEVICE constexpr T
fovx() const noexcept;
112 ATOMSMATH_HOSTDEVICE constexpr T
fovy() const noexcept;
115 ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 T
aspect() const noexcept;
119 ATOMSMATH_CONSTEXPR14 T
aspectExc() const;
129 ATOMSMATH_HOSTDEVICE constexpr
bool degenerate() const noexcept;
137 ATOMSMATH_HOSTDEVICE
void
158 ATOMSMATH_HOSTDEVICE
void planes (
Plane3<T> p[6]) const noexcept;
171 ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 ATOMSMATH_HOSTDEVICE
Frustum<T>
190 ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 T
ZToDepth (
long zval,
192 long max) const noexcept;
194 ATOMSMATH_CONSTEXPR14 T
ZToDepthExc (
long zval,
long min,
long max) const;
197 ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 T
normalizedZToDepth (T zval) const noexcept;
204 ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14
long
205 DepthToZ (T depth,
long zmin,
long zmax) const noexcept;
208 ATOMSMATH_CONSTEXPR14
long DepthToZExc (T depth,
long zmin,
long zmax) const;
211 ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 T
worldRadius (const
Vec3<T>& p, T radius) const noexcept;
217 ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 T
screenRadius (const
Vec3<T>& p, T radius) const noexcept;
230 ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14
Vec2<T>
254 set (T (0.1), T (1000.0), T (-1.0), T (1.0), T (1.0), T (-1.0),
false);
265 set (n, f, l, r, t, b, o);
278 ATOMSMATH_CONSTEXPR14
inline const Frustum<T>&
281 _nearPlane = f._nearPlane;
282 _farPlane = f._farPlane;
287 _orthographic = f._orthographic;
293 constexpr
inline bool
296 return _nearPlane == src._nearPlane && _farPlane == src._farPlane && _left == src._left &&
297 _right == src._right && _top == src._top && _bottom == src._bottom &&
298 _orthographic == src._orthographic;
302 constexpr
inline bool
355 _orthographic = ortho;
362 #ifdef ATOMS_USE_EXCEPTIONS
364 throw std::domain_error (
"fovx and fovy cannot both be non-zero.");
366 const T two =
static_cast<T
> (2);
372 _top = ((_right - _left) /
aspect) / two;
379 _right = (_top - _bottom) *
aspect / two;
384 _orthographic =
false;
391 const T two =
static_cast<T
> (2);
397 _top = ((_right - _left) /
aspect) / two;
404 _right = (_top - _bottom) *
aspect / two;
409 _orthographic =
false;
416 return std::atan2 (_right, _nearPlane) - std::atan2 (_left, _nearPlane);
423 return std::atan2 (_top, _nearPlane) - std::atan2 (_bottom, _nearPlane);
427 ATOMSMATH_CONSTEXPR14
inline T
430 T rightMinusLeft = _right - _left;
431 T topMinusBottom = _top - _bottom;
433 #ifdef ATOMS_USE_EXCEPTIONS
434 if (abs (topMinusBottom) < T (1) && abs (rightMinusLeft) > std::numeric_limits<T>::max() * abs (topMinusBottom))
436 throw std::domain_error (
"Bad viewing frustum: "
437 "aspect ratio cannot be computed.");
440 return rightMinusLeft / topMinusBottom;
444 ATOMSMATH_CONSTEXPR14
inline T
447 T rightMinusLeft = _right - _left;
448 T topMinusBottom = _top - _bottom;
449 return rightMinusLeft / topMinusBottom;
456 T rightPlusLeft = _right + _left;
457 T rightMinusLeft = _right - _left;
459 T topPlusBottom = _top + _bottom;
460 T topMinusBottom = _top - _bottom;
462 T farPlusNear = _farPlane + _nearPlane;
463 T farMinusNear = _farPlane - _nearPlane;
464 #ifdef ATOMS_USE_EXCEPTIONS
465 if ((abs (rightMinusLeft) < T (1) &&
466 abs (rightPlusLeft) > std::numeric_limits<T>::max() * abs (rightMinusLeft)) ||
467 (abs (topMinusBottom) < T (1) &&
468 abs (topPlusBottom) > std::numeric_limits<T>::max() * abs (topMinusBottom)) ||
469 (abs (farMinusNear) < 1 && abs (farPlusNear) > std::numeric_limits<T>::max() * abs (farMinusNear)))
471 throw std::domain_error (
"Bad viewing frustum: "
472 "projection matrix cannot be computed.");
477 T tx = -rightPlusLeft / rightMinusLeft;
478 T ty = -topPlusBottom / topMinusBottom;
479 T tz = -farPlusNear / farMinusNear;
480 #ifdef ATOMS_USE_EXCEPTIONS
481 if ((abs (rightMinusLeft) < T (1) && T (2) > std::numeric_limits<T>::max() * abs (rightMinusLeft)) ||
482 (abs (topMinusBottom) < T (1) && T (2) > std::numeric_limits<T>::max() * abs (topMinusBottom)) ||
483 (abs (farMinusNear) < T (1) && T (2) > std::numeric_limits<T>::max() * abs (farMinusNear)))
485 throw std::domain_error (
"Bad viewing frustum: "
486 "projection matrix cannot be computed.");
489 T A = T (2) / rightMinusLeft;
490 T B = T (2) / topMinusBottom;
491 T C = T (-2) / farMinusNear;
493 return Matrix44<T> (A, 0, 0, 0, 0, B, 0, 0, 0, 0, C, 0, tx, ty, tz, 1.f);
497 T A = rightPlusLeft / rightMinusLeft;
498 T B = topPlusBottom / topMinusBottom;
499 T C = -farPlusNear / farMinusNear;
501 T farTimesNear = T (-2) * _farPlane * _nearPlane;
502 #ifdef ATOMS_USE_EXCEPTIONS
503 if (abs (farMinusNear) < T (1) && abs (farTimesNear) > std::numeric_limits<T>::max() * abs (farMinusNear))
505 throw std::domain_error (
"Bad viewing frustum: "
506 "projection matrix cannot be computed.");
509 T D = farTimesNear / farMinusNear;
511 T twoTimesNear = T (2) * _nearPlane;
512 #ifdef ATOMS_USE_EXCEPTIONS
513 if ((abs (rightMinusLeft) < T (1) &&
514 abs (twoTimesNear) > std::numeric_limits<T>::max() * abs (rightMinusLeft)) ||
515 (abs (topMinusBottom) < T (1) &&
516 abs (twoTimesNear) > std::numeric_limits<T>::max() * abs (topMinusBottom)))
518 throw std::domain_error (
"Bad viewing frustum: "
519 "projection matrix cannot be computed.");
522 T E = twoTimesNear / rightMinusLeft;
523 T F = twoTimesNear / topMinusBottom;
525 return Matrix44<T> (E, 0, 0, 0, 0, F, 0, 0, A, B, C, -1, 0, 0, D, 0);
533 T rightPlusLeft = _right + _left;
534 T rightMinusLeft = _right - _left;
536 T topPlusBottom = _top + _bottom;
537 T topMinusBottom = _top - _bottom;
539 T farPlusNear = _farPlane + _nearPlane;
540 T farMinusNear = _farPlane - _nearPlane;
544 T tx = -rightPlusLeft / rightMinusLeft;
545 T ty = -topPlusBottom / topMinusBottom;
546 T tz = -farPlusNear / farMinusNear;
548 T A = T (2) / rightMinusLeft;
549 T B = T (2) / topMinusBottom;
550 T C = T (-2) / farMinusNear;
552 return Matrix44<T> (A, 0, 0, 0, 0, B, 0, 0, 0, 0, C, 0, tx, ty, tz, 1.f);
556 T A = rightPlusLeft / rightMinusLeft;
557 T B = topPlusBottom / topMinusBottom;
558 T C = -farPlusNear / farMinusNear;
560 T farTimesNear = T (-2) * _farPlane * _nearPlane;
562 T D = farTimesNear / farMinusNear;
564 T twoTimesNear = T (2) * _nearPlane;
566 T E = twoTimesNear / rightMinusLeft;
567 T F = twoTimesNear / topMinusBottom;
569 return Matrix44<T> (E, 0, 0, 0, 0, F, 0, 0, A, B, C, -1, 0, 0, D, 0);
574 constexpr
inline bool
577 return (_nearPlane == _farPlane) || (_left == _right) || (_top == _bottom);
589 return Frustum<T> (_nearPlane, _farPlane, bl.x, tr.x, tr.y, bl.y, _orthographic);
596 return Vec2<T> (_left + (_right - _left) * (1.f + s.x) / 2.f,
597 _bottom + (_top - _bottom) * (1.f + s.y) / 2.f);
601 ATOMSMATH_CONSTEXPR14
inline Vec2<T>
604 T leftPlusRight = _left - T (2) * p.x + _right;
605 T leftMinusRight = _left - _right;
606 T bottomPlusTop = _bottom - T (2) * p.y + _top;
607 T bottomMinusTop = _bottom - _top;
608 #ifdef ATOMS_USE_EXCEPTIONS
609 if ((abs (leftMinusRight) < T (1) &&
610 abs (leftPlusRight) > std::numeric_limits<T>::max() * abs (leftMinusRight)) ||
611 (abs (bottomMinusTop) < T (1) &&
612 abs (bottomPlusTop) > std::numeric_limits<T>::max() * abs (bottomMinusTop)))
614 throw std::domain_error (
"Bad viewing frustum: "
615 "local-to-screen transformation cannot be computed");
618 return Vec2<T> (leftPlusRight / leftMinusRight, bottomPlusTop / bottomMinusTop);
622 ATOMSMATH_CONSTEXPR14
inline Vec2<T>
625 T leftPlusRight = _left - T (2) * p.x + _right;
626 T leftMinusRight = _left - _right;
627 T bottomPlusTop = _bottom - T (2) * p.y + _top;
628 T bottomMinusTop = _bottom - _top;
630 return Vec2<T> (leftPlusRight / leftMinusRight, bottomPlusTop / bottomMinusTop);
634 ATOMSMATH_CONSTEXPR14
inline Line3<T>
652 Vec2<T> (point.x * _nearPlane / -point.z, point.y * _nearPlane / -point.z));
663 Vec2<T> (point.x * _nearPlane / -point.z, point.y * _nearPlane / -point.z));
667 ATOMSMATH_CONSTEXPR14 T
670 int zdiff = zmax - zmin;
671 #ifdef ATOMS_USE_EXCEPTIONS
674 throw std::domain_error (
"Bad call to Frustum::ZToDepth: zmax == zmin");
680 T fzval = (T (zval) - T (zmin)) / T (zdiff);
685 ATOMSMATH_CONSTEXPR14 T
688 int zdiff = zmax - zmin;
693 T fzval = (T (zval) - T (zmin)) / T (zdiff);
698 ATOMSMATH_CONSTEXPR14 T
701 T Zp = zval * T (2) - T (1);
705 return -(Zp * (_farPlane - _nearPlane) + (_farPlane + _nearPlane)) / T (2);
709 T farTimesNear = 2 * _farPlane * _nearPlane;
710 T farMinusNear = Zp * (_farPlane - _nearPlane) - _farPlane - _nearPlane;
711 #ifdef ATOMS_USE_EXCEPTIONS
712 if (abs (farMinusNear) < 1 && abs (farTimesNear) > std::numeric_limits<T>::max() * abs (farMinusNear))
714 throw std::domain_error (
"Frustum::normalizedZToDepth cannot be computed: "
715 "near and far clipping planes of the viewing frustum "
716 "may be too close to each other");
719 return farTimesNear / farMinusNear;
724 ATOMSMATH_CONSTEXPR14 T
727 T Zp = zval * T (2) - T (1);
731 return -(Zp * (_farPlane - _nearPlane) + (_farPlane + _nearPlane)) / T (2);
735 T farTimesNear = 2 * _farPlane * _nearPlane;
736 T farMinusNear = Zp * (_farPlane - _nearPlane) - _farPlane - _nearPlane;
738 return farTimesNear / farMinusNear;
743 ATOMSMATH_CONSTEXPR14
long
746 long zdiff = zmax - zmin;
747 T farMinusNear = _farPlane - _nearPlane;
751 T farPlusNear = T (2) * depth + _farPlane + _nearPlane;
752 #ifdef ATOMS_USE_EXCEPTIONS
753 if (abs (farMinusNear) < T (1) && abs (farPlusNear) > std::numeric_limits<T>::max() * abs (farMinusNear))
755 throw std::domain_error (
"Bad viewing frustum: "
756 "near and far clipping planes "
757 "are too close to each other");
760 T Zp = -farPlusNear / farMinusNear;
761 return long (0.5 * (Zp + 1) * zdiff) + zmin;
767 T farTimesNear = T (2) * _farPlane * _nearPlane;
768 #ifdef ATOMS_USE_EXCEPTIONS
769 if (abs (depth) < T (1) && abs (farTimesNear) > std::numeric_limits<T>::max() * abs (depth))
771 throw std::domain_error (
"Bad call to DepthToZ function: "
772 "value of `depth' is too small");
775 T farPlusNear = farTimesNear / depth + _farPlane + _nearPlane;
776 #ifdef ATOMS_USE_EXCEPTIONS
777 if (abs (farMinusNear) < T (1) && abs (farPlusNear) > std::numeric_limits<T>::max() * abs (farMinusNear))
779 throw std::domain_error (
"Bad viewing frustum: "
780 "near and far clipping planes "
781 "are too close to each other");
784 T Zp = farPlusNear / farMinusNear;
785 return long (0.5 * (Zp + 1) * zdiff) + zmin;
790 ATOMSMATH_CONSTEXPR14
long
793 long zdiff = zmax - zmin;
794 T farMinusNear = _farPlane - _nearPlane;
798 T farPlusNear = T (2) * depth + _farPlane + _nearPlane;
800 T Zp = -farPlusNear / farMinusNear;
801 return long (0.5 * (Zp + 1) * zdiff) + zmin;
807 T farTimesNear = T (2) * _farPlane * _nearPlane;
809 T farPlusNear = farTimesNear / depth + _farPlane + _nearPlane;
811 T Zp = farPlusNear / farMinusNear;
812 return long (0.5 * (Zp + 1) * zdiff) + zmin;
817 ATOMSMATH_CONSTEXPR14 T
830 if (abs (p.z) > T (1) || abs (-_nearPlane) < std::numeric_limits<T>::max() * abs (p.z))
832 return radius * (-_nearPlane / p.z);
836 #ifdef ATOMS_USE_EXCEPTIONS
837 throw std::domain_error (
"Bad call to Frustum::screenRadius: "
838 "magnitude of `p' is too small");
842 return radius * (-_nearPlane / p.z);
846 ATOMSMATH_CONSTEXPR14 T
859 return radius * (-_nearPlane / p.z);
863 ATOMSMATH_CONSTEXPR14 T
866 if (abs (-_nearPlane) > T (1) || abs (p.z) < std::numeric_limits<T>::max() * abs (-_nearPlane))
868 return radius * (p.z / -_nearPlane);
872 #ifdef ATOMS_USE_EXCEPTIONS
873 throw std::domain_error (
"Bad viewing frustum: "
874 "near clipping plane is too close to zero");
880 ATOMSMATH_CONSTEXPR14 T
883 return radius * (p.z / -_nearPlane);
897 Vec3<T> a (_left, _bottom, -_nearPlane);
898 Vec3<T> b (_left, _top, -_nearPlane);
899 Vec3<T> c (_right, _top, -_nearPlane);
900 Vec3<T> d (_right, _bottom, -_nearPlane);
910 p[0].set (
Vec3<T> (0, 1, 0), _top);
911 p[1].set (
Vec3<T> (1, 0, 0), _right);
912 p[2].set (
Vec3<T> (0, -1, 0), -_bottom);
913 p[3].set (
Vec3<T> (-1, 0, 0), -_left);
915 p[4].set (
Vec3<T> (0, 0, 1), -_nearPlane);
916 p[5].set (
Vec3<T> (0, 0, -1), _farPlane);
934 double s = _farPlane / double (_nearPlane);
935 T farLeft = (T) (s * _left);
936 T farRight = (T) (s * _right);
937 T farTop = (T) (s * _top);
938 T farBottom = (T) (s * _bottom);
971 ATOMSMATH_INTERNAL_NAMESPACE_HEADER_EXIT
973 #if defined _WIN32 || defined _WIN64
Definition: ImathFrustum.h:38
ATOMSMATH_CONSTEXPR14 Vec2< T > projectPointToScreenExc(const Vec3< T > &) const
Definition: ImathFrustum.h:646
constexpr ATOMSMATH_HOSTDEVICE T bottom() const noexcept
Return the bottom of the frustum.
Definition: ImathFrustum.h:103
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 T aspect() const noexcept
Return the aspect ratio.
Definition: ImathFrustum.h:445
constexpr ATOMSMATH_HOSTDEVICE T hither() const noexcept
Return the near clipping plane.
Definition: ImathFrustum.h:88
void setExc(T nearPlane, T farPlane, T fovx, T fovy, T aspect)
Definition: ImathFrustum.h:360
virtual ~Frustum() noexcept
Destructor.
Definition: ImathFrustum.h:274
ATOMSMATH_HOSTDEVICE void modifyNearAndFar(T nearPlane, T farPlane) noexcept
Set the near and far clipping planes.
Definition: ImathFrustum.h:323
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Matrix44< T > projectionMatrix() const noexcept
Return the project matrix that the frustum defines.
Definition: ImathFrustum.h:531
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Line3< T > projectScreenToRay(const Vec2< T > &) const noexcept
Project a point in screen spaced to 3d ray.
Definition: ImathFrustum.h:635
ATOMSMATH_HOSTDEVICE void planes(Plane3< T > p[6]) const noexcept
Definition: ImathFrustum.h:888
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Vec2< T > localToScreen(const Vec2< T > &) const noexcept
Map point from local space to screen space.
Definition: ImathFrustum.h:623
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 T normalizedZToDepth(T zval) const noexcept
Map a normalized z value to its depth in the frustum.
Definition: ImathFrustum.h:725
ATOMSMATH_CONSTEXPR14 long DepthToZExc(T depth, long zmin, long zmax) const
Map depth to z value. Throw an exception on error.
Definition: ImathFrustum.h:744
constexpr ATOMSMATH_HOSTDEVICE bool orthographic() const noexcept
Return true if the frustum is orthographic, false if perspective.
Definition: ImathFrustum.h:82
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Frustum() noexcept
Definition: ImathFrustum.h:252
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Vec2< T > projectPointToScreen(const Vec3< T > &) const noexcept
Project a 3D point into screen coordinates.
Definition: ImathFrustum.h:657
constexpr ATOMSMATH_HOSTDEVICE bool degenerate() const noexcept
Return true if the frustum is degenerate.
Definition: ImathFrustum.h:575
ATOMSMATH_CONSTEXPR14 Vec2< T > localToScreenExc(const Vec2< T > &) const
Definition: ImathFrustum.h:602
constexpr ATOMSMATH_HOSTDEVICE T yon() const noexcept
Return the far clipping plane.
Definition: ImathFrustum.h:94
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 T ZToDepth(long zval, long min, long max) const noexcept
Map a z value to its depth in the frustum.
Definition: ImathFrustum.h:686
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 long DepthToZ(T depth, long zmin, long zmax) const noexcept
Map depth to z value.
Definition: ImathFrustum.h:791
constexpr ATOMSMATH_HOSTDEVICE Vec2< T > screenToLocal(const Vec2< T > &) const noexcept
Map point from screen space to local space.
Definition: ImathFrustum.h:594
constexpr ATOMSMATH_HOSTDEVICE T farPlane() const noexcept
Return the far clipping plane.
Definition: ImathFrustum.h:91
ATOMSMATH_HOSTDEVICE void set(T nearPlane, T farPlane, T left, T right, T top, T bottom, bool ortho=false) noexcept
Set functions change the entire state of the Frustum.
Definition: ImathFrustum.h:310
ATOMSMATH_CONSTEXPR14 T screenRadiusExc(const Vec3< T > &p, T radius) const
Compute screen radius. Throw an exception on error.
Definition: ImathFrustum.h:818
constexpr ATOMSMATH_HOSTDEVICE bool operator==(const Frustum< T > &src) const noexcept
Equality.
Definition: ImathFrustum.h:294
ATOMSMATH_CONSTEXPR14 Matrix44< T > projectionMatrixExc() const
Definition: ImathFrustum.h:454
ATOMSMATH_HOSTDEVICE void setOrthographic(bool) noexcept
Set the ortographic state.
Definition: ImathFrustum.h:353
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 T screenRadius(const Vec3< T > &p, T radius) const noexcept
Compute screen radius.
Definition: ImathFrustum.h:847
ATOMSMATH_CONSTEXPR14 T normalizedZToDepthExc(T zval) const
Definition: ImathFrustum.h:699
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 ATOMSMATH_HOSTDEVICE Frustum< T > window(T left, T right, T top, T bottom) const noexcept
Definition: ImathFrustum.h:582
constexpr ATOMSMATH_HOSTDEVICE T left() const noexcept
Return the left of the frustum.
Definition: ImathFrustum.h:97
ATOMSMATH_CONSTEXPR14 T aspectExc() const
Definition: ImathFrustum.h:428
constexpr ATOMSMATH_HOSTDEVICE T fovx() const noexcept
Return the field of view in X.
Definition: ImathFrustum.h:414
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 T worldRadius(const Vec3< T > &p, T radius) const noexcept
Compute worldRadius.
Definition: ImathFrustum.h:881
ATOMSMATH_CONSTEXPR14 T ZToDepthExc(long zval, long min, long max) const
Map a z value to its depth in the frustum.
Definition: ImathFrustum.h:668
constexpr ATOMSMATH_HOSTDEVICE bool operator!=(const Frustum< T > &src) const noexcept
Inequality.
Definition: ImathFrustum.h:303
constexpr ATOMSMATH_HOSTDEVICE T fovy() const noexcept
Return the field of view in Y.
Definition: ImathFrustum.h:421
ATOMSMATH_CONSTEXPR14 T worldRadiusExc(const Vec3< T > &p, T radius) const
Compute worldRadius. Throw an exception on error.
Definition: ImathFrustum.h:864
constexpr ATOMSMATH_HOSTDEVICE T nearPlane() const noexcept
Return the near clipping plane.
Definition: ImathFrustum.h:85
constexpr ATOMSMATH_HOSTDEVICE T top() const noexcept
Return the top of the frustum.
Definition: ImathFrustum.h:106
constexpr ATOMSMATH_HOSTDEVICE T right() const noexcept
Return the right of the frustum.
Definition: ImathFrustum.h:100
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Frustum & operator=(const Frustum &) noexcept
Component-wise assignment.
Definition: ImathFrustum.h:279
Definition: ImathLine.h:25
Definition: ImathMatrix.h:631
Definition: ImathPlane.h:30
Definition: ImathVec.h:43
Definition: ImathVec.h:260