65 if( ( tPlane >= aHitInfo.
m_tHit ) || ( tPlane < FLT_EPSILON ) )
71 float dSquared =
m_segment.DistanceToPointSquared( planeHitPoint2d );
75 if( tPlane < aHitInfo.
m_tHit )
94 if( normal_dot_ray < 0.0f )
98 const float t = n_dot_ray_origin / normal_dot_ray;
105 const float len = glm::dot( v, v );
108 && ( hitP.z <=
m_bbox.Max().z ) )
131 if( normal_dot_ray < 0.0f )
135 const float t = n_dot_ray_origin / normal_dot_ray;
142 const float len = glm::dot( v, v );
145 && ( hitP.z <=
m_bbox.Max().z ) )
171 const double p_dot_p_Start = OCx_Start * OCx_Start + OCy_Start * OCy_Start;
173 const double a = (double)aRay.
m_Dir.x * (
double)aRay.
m_Dir.x +
176 const double b_Start = (double)aRay.
m_Dir.x * (
double)OCx_Start +
177 (double)aRay.
m_Dir.y * (
double)OCy_Start;
181 const float delta_Start = (float) ( b_Start * b_Start - a * c_Start );
183 if( delta_Start > FLT_EPSILON )
185 const float sdelta = sqrtf( delta_Start );
186 const float t = ( -b_Start - sdelta ) / a;
189 if( ( z >=
m_bbox.Min().z ) && ( z <=
m_bbox.Max().z ) )
216 const double p_dot_p_End = OCx_End * OCx_End + OCy_End * OCy_End;
218 const double b_End = (double)aRay.
m_Dir.x * (
double)OCx_End +
219 (double)aRay.
m_Dir.y * (
double)OCy_End;
223 const float delta_End = (float)(b_End * b_End - a * c_End);
225 if( delta_End > FLT_EPSILON )
227 const float sdelta = sqrtf( delta_End );
228 const float t = ( -b_End - sdelta ) / a;
231 if( ( z >=
m_bbox.Min().z ) && ( z <=
m_bbox.Max().z ) )
265 if( ( tPlane >= aMaxDistance) || ( tPlane < FLT_EPSILON ) )
271 const float dSquared =
m_segment.DistanceToPointSquared( planeHitPoint2d );
275 if( tPlane < aMaxDistance )
290 if( normal_dot_ray < 0.0f )
293 float t = n_dot_ray_origin / normal_dot_ray;
300 float len = glm::dot( v, v );
303 ( hitP.z >=
m_bbox.Min().z ) && ( hitP.z <=
m_bbox.Max().z ) )
305 if( t < aMaxDistance )
316 if( normal_dot_ray < 0.0f )
320 const float t = n_dot_ray_origin / normal_dot_ray;
327 float len = glm::dot( v, v );
330 ( hitP.z >=
m_bbox.Min().z ) && ( hitP.z <=
m_bbox.Max().z ) )
332 if( t < aMaxDistance )
347 double p_dot_p_Start = OCx_Start * OCx_Start + OCy_Start * OCy_Start;
349 double a = (double)aRay.
m_Dir.x * (
double)aRay.
m_Dir.x +
352 double b_Start = (double)aRay.
m_Dir.x * (
double)OCx_Start +
353 (double)aRay.
m_Dir.y * (
double)OCy_Start;
357 float delta_Start = (float)( b_Start * b_Start - a * c_Start );
359 if( delta_Start > FLT_EPSILON )
361 float sdelta = sqrtf( delta_Start );
362 float t = ( -b_Start - sdelta ) / a;
365 if( ( z >=
m_bbox.Min().z ) && ( z <=
m_bbox.Max().z ) )
367 if( t < aMaxDistance )
377 double p_dot_p_End = OCx_End * OCx_End + OCy_End * OCy_End;
380 double b_End = (double)aRay.
m_Dir.x * (
double)OCx_End +
381 (double)aRay.
m_Dir.y * (
double)OCy_End;
385 float delta_End = (float)(b_End * b_End - a * c_End);
387 if( delta_End > FLT_EPSILON )
389 float sdelta = sqrtf( delta_End );
390 float t = ( -b_End - sdelta ) / a;
393 if( ( z >=
m_bbox.Min().z ) && ( z <=
m_bbox.Max().z ) )
395 if( t < aMaxDistance )