16 template <
typename Real>
33 template <
typename Real>
53 Real lineParameter[2], segmentParameter[2];
61 template <
typename Real>
69 segment.GetCenteredForm(segOrigin, segDirection, segExtent);
72 auto llResult = llQuery(line,
Line2<Real>(segOrigin, segDirection));
73 if (llResult.numIntersections == 1)
76 if (
std::abs(llResult.line1Parameter[0]) <= segExtent)
78 result.intersect =
true;
79 result.numIntersections = 1;
83 result.intersect =
false;
84 result.numIntersections = 0;
89 result.intersect = llResult.intersect;
90 result.numIntersections = llResult.numIntersections;
95 template <
typename Real>
103 segment.GetCenteredForm(segOrigin, segDirection, segExtent);
106 auto llResult = llQuery(line,
Line2<Real>(segOrigin, segDirection));
107 if (llResult.numIntersections == 1)
110 if (
std::abs(llResult.line1Parameter[0]) <= segExtent)
112 result.intersect =
true;
113 result.numIntersections = 1;
114 result.lineParameter[0] = llResult.line0Parameter[0];
115 result.segmentParameter[0] = llResult.line1Parameter[0];
116 result.point = llResult.point;
120 result.intersect =
false;
121 result.numIntersections = 0;
124 else if (llResult.numIntersections == std::numeric_limits<int>::max())
126 result.intersect =
true;
127 result.numIntersections = std::numeric_limits<int>::max();
128 Real maxReal = std::numeric_limits<Real>::max();
129 result.lineParameter[0] = -maxReal;
130 result.lineParameter[1] = +maxReal;
131 result.segmentParameter[0] = -segExtent;
132 result.segmentParameter[1] = +segExtent;
136 result.intersect =
false;
137 result.numIntersections = 0;
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
Result operator()(Type0 const &primitive0, Type1 const &primitive1)