29 template <
typename Real>
32 public TIQuery<Real, AlignedBox<3, Real>, Cone<3, Real>>
37 public TIQuery<Real, AlignedBox<3, Real>, Cone<3, Real>>::Result
46 template <
typename Real>
51 template <
typename Real>
61 Dot(cone.ray.direction, box.axis[0]),
62 Dot(cone.ray.direction, box.axis[1]),
63 Dot(cone.ray.direction, box.axis[2]) };
64 Real DdCmV =
Dot(cone.ray.direction, CmV);
69 if (DdCmV + radius <= (Real)0)
72 result.intersect =
false;
78 if (cone.height < std::numeric_limits<Real>::max())
80 if (DdCmV - radius >= cone.height)
84 result.intersect =
false;
94 Dot(box.axis[0], CmV),
95 Dot(box.axis[1], CmV),
96 Dot(box.axis[2], CmV) };
98 (UdCmV[0] < -box.extent[0] ? 2 : (UdCmV[0] > box.extent[0] ? 0 : 1)),
99 (UdCmV[1] < -box.extent[1] ? 2 : (UdCmV[1] > box.extent[1] ? 0 : 1)),
100 (UdCmV[2] < -box.extent[2] ? 2 : (UdCmV[2] > box.extent[2] ? 0 : 1))
102 int lookup = index[0] + 3 * index[1] + 9 * index[2];
106 result.intersect =
true;
110 auto const& polygon = this->mPolygon[lookup];
112 this->DoQuery(box.extent, cone.cosAngleSqr, DdU, UdCmV, DdCmV, polygon,
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
Result operator()(Type0 const &primitive0, Type1 const &primitive1)