36 m_segment( aStart, aEnd )
38 wxASSERT( aStart != aEnd );
51 SFVEC2F rightRadiusOffset( -leftRadiusOffset.x, -leftRadiusOffset.y );
133 if( start_is_inside && end_is_inside )
138 float closerHitT = FLT_MAX;
139 float farHitT = FLT_MAX;
145 const bool leftSegmentHit =
151 closerHitT = leftSegT;
159 const bool rightSegmentHit =
162 if( rightSegmentHit )
164 if( !start_is_inside )
166 if( ( hitted ==
false ) || ( rightSegT < closerHitT ) )
168 closerHitT = rightSegT;
174 if( ( hitted ==
false ) || ( rightSegT > farHitT ) )
184 float circleStart_T0;
185 float circleStart_T1;
190 &circleStart_T0, &circleStart_T1,
191 &circleStart_N0, &circleStart_N1 );
195 if( circleStart_T0 > 0.0f )
197 if( !start_is_inside )
199 if( ( hitted ==
false ) || ( circleStart_T0 < closerHitT ) )
201 closerHitT = circleStart_T0;
202 closerHitNormal = circleStart_N0;
207 if( ( hitted ==
false ) || ( circleStart_T1 > farHitT ) )
209 farHitT = circleStart_T1;
210 farHitNormal = circleStart_N1;
217 if( ( hitted ==
false ) || ( circleStart_T1 > farHitT ) )
219 farHitT = circleStart_T1;
220 farHitNormal = circleStart_N1;
233 &circleEnd_T0, &circleEnd_T1,
234 &circleEnd_N0, &circleEnd_N1 );
237 if( circleEnd_T0 > 0.0f )
239 if( !start_is_inside )
241 if( ( hitted ==
false ) || ( circleEnd_T0 < closerHitT ) )
243 closerHitT = circleEnd_T0;
244 closerHitNormal = circleEnd_N0;
249 if( ( hitted ==
false ) || ( circleEnd_T1 > farHitT ) )
251 farHitT = circleEnd_T1;
252 farHitNormal = circleEnd_N1;
259 if( ( hitted ==
false ) || ( circleEnd_T1 > farHitT ) )
261 farHitT = circleEnd_T1;
262 farHitNormal = circleEnd_N1;
271 if( !start_is_inside )
278 *aNormalOut = closerHitNormal;
282 wxASSERT( (farHitT >= 0.0f) && (farHitT <= 1.0f) );
288 *aNormalOut = -farHitNormal;
299 return INTERSECTION_RESULT::MISSES;
316 if( isInside[0] && isInside[1] && isInside[2] && isInside[3] )
317 return INTERSECTION_RESULT::FULL_INSIDE;
320 if( isInside[0] || isInside[1] || isInside[2] || isInside[3] )
321 return INTERSECTION_RESULT::INTERSECTS;
323 return INTERSECTION_RESULT::MISSES;
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
bool IsPointInside(const SFVEC2F &aPoint) const override
bool Overlaps(const BBOX_2D &aBBox) const override
Test if the box overlaps the object.
bool Intersect(const RAYSEG2D &aSegRay, float *aOutT, SFVEC2F *aNormalOut) const override
ROUND_SEGMENT_2D(const SFVEC2F &aStart, const SFVEC2F &aEnd, float aWidth, const BOARD_ITEM &aBoardItem)
INTERSECTION_RESULT IsBBoxInside(const BBOX_2D &aBBox) const override
Test this object if it's completely outside, intersects, or is completely inside aBBox.
bool Intersects(const BBOX_2D &aBBox) const override
a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅)
SFVEC2F m_rightEndMinusStart
SFVEC2F m_leftEndMinusStart
bool IntersectSegment(const SFVEC2F &aStartA, const SFVEC2F &aEnd_minus_startA, const SFVEC2F &aStartB, const SFVEC2F &aEnd_minus_startB)
Manage a bounding box defined by two SFVEC2F min max points.
SFVEC2F GetCenter() const
bool Intersects(const BBOX_2D &aBBox) const
Test if a bounding box intersects this box.
bool IsInitialized() const
Check if this bounding box is already initialized.
const SFVEC2F & Min() const
void Reset()
Reset the bounding box to zero and uninitialize it.
const SFVEC2F & Max() const
void Set(const SFVEC2F &aPbMin, const SFVEC2F &aPbMax)
Set bounding box with new parameters.
void ScaleNextUp()
Scale a bounding box to the next float representation making it larger.
bool IntersectCircle(const SFVEC2F &aCenter, float aRadius, float *aOutT0, float *aOutT1, SFVEC2F *aOutNormalT0, SFVEC2F *aOutNormalT1) const
bool IntersectSegment(const SFVEC2F &aStart, const SFVEC2F &aEnd_minus_start, float *aOutT) const
float DistanceToPointSquared(const SFVEC2F &aPoint) const