43#ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_DISK_3D_RAY_3D_H
44#define LASS_GUARDIAN_OF_INCLUSION_PRIM_DISK_3D_RAY_3D_H
59template <
typename T,
class NP,
class PP>
62 typedef typename Disk3D<T>::TPlane TPlane;
63 typedef typename Disk3D<T>::TVector TVector;
64 typedef typename Disk3D<T>::TNumTraits TNumTraits;
67 const TPlane& plane = disk.plane();
68 const Result result = intersect(plane, ray, tCandidate, tMin);
74 const TVector delta = ray.point(tCandidate) - disk.center();
75 const T sqrDist = delta.squaredNorm();
76 if (sqrDist >
num::sqr(disk.radius()))
81 const T x = dot(delta, plane.directionU());
82 const T y = dot(delta, plane.directionV());
85 u = num::sqrt(sqrDist) / disk.radius();
86 v = num::atan2(y, x) / (2 * TNumTraits::pi);
97template <
typename T,
class NP,
class PP>
102 return intersect(disk, ray, u, v, t, tMin);
T sqr(const T &x)
return x * x
set of geometrical primitives
Result
meta information on the result you have from an operation like an intersection ...
@ rNone
operation has no answer, output arguments are meaningless
@ rOne
there's exactly one answer, 1 output argument contains the answer
Library for Assembled Shared Sources.