39 template <
typename Real>
51 template <
typename Real>
60 Real sqrLengthCmV =
Dot(CmV, CmV);
61 Real lengthCmV = sqrt(sqrLengthCmV);
62 if (lengthCmV > disk.radius + sector.radius)
65 result.intersect =
false;
71 Vector2<Real> U = sector.vertex - (disk.radius / sector.sinAngle) * sector.direction;
73 Real lengthCmU =
Length(CmU);
74 if (
Dot(sector.direction, CmU) < lengthCmU * sector.cosAngle)
77 result.intersect =
false;
81 Real dotDirCmV =
Dot(sector.direction, CmV);
82 if (-dotDirCmV >= lengthCmV * sector.sinAngle)
85 if (lengthCmV <= disk.radius)
89 result.intersect =
true;
94 result.intersect =
false;
109 +sector.cosAngle * sector.direction[0] + sector.sinAngle * sector.direction[1],
110 -sector.sinAngle * sector.direction[0] + sector.cosAngle * sector.direction[1]
112 Real dp0 =
Dot(U0, CmV);
113 Real discr0 = disk.radius * disk.radius + dp0 * dp0 - sqrLengthCmV;
114 if (discr0 >= (Real)0)
120 Real tmin = dp0 - sqrt(discr0);
121 if (sector.radius >= tmin)
124 result.intersect =
true;
133 if (dotDirCmV <= lengthCmV * sector.cosAngle)
136 result.intersect =
false;
147 +sector.cosAngle * sector.direction[0] - sector.sinAngle * sector.direction[1],
148 +sector.sinAngle * sector.direction[0] + sector.cosAngle * sector.direction[1]
150 Real dp1 =
Dot(U1, CmV);
151 Real discr1 = disk.radius * disk.radius + dp1 * dp1 - sqrLengthCmV;
152 if (discr1 >= (Real)0)
158 Real tmin = dp1 - sqrt(discr1);
159 if (sector.radius >= tmin)
161 result.intersect =
true;
170 if (dotDirCmV <= lengthCmV * sector.cosAngle)
173 result.intersect =
false;
181 result.intersect =
true;
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
DualQuaternion< Real > Length(DualQuaternion< Real > const &d, bool robust=false)
Result operator()(Type0 const &primitive0, Type1 const &primitive1)