44 unsigned int j = 4 - 1;
46 for( i = 0; i < 4; j = i++ )
85 unsigned int hitIndex;
88 for(
unsigned int i = 0; i < 4; i++ )
94 if( ( hited ==
false ) || ( t < bestHitT ) )
105 wxASSERT( ( bestHitT >= 0.0f ) && ( bestHitT <= 1.0f ) );
124 return INTERSECTION_RESULT::MISSES;
131 unsigned int j = 4 - 1;
132 bool oddNodes =
false;
134 for( i = 0; i < 4; j = i++ )
139 if( ( ( polyIY <= aPoint.y ) && ( polyJY >= aPoint.y ) )
140 || ( ( polyJY <= aPoint.y ) && ( polyIY >= aPoint.y ) ) )
145 if( ( polyIX <= aPoint.x ) || ( polyJX <= aPoint.x ) )
147 oddNodes ^= ( ( polyIX + ( ( aPoint.y - polyIY ) / ( polyJY - polyIY ) )
148 * ( polyJX - polyIX ) )
A simplified non-intersecting 4 point polygon.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
bool Intersect(const RAYSEG2D &aSegRay, float *aOutT, SFVEC2F *aNormalOut) const override
bool Intersects(const BBOX_2D &aBBox) const override
a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅)
SFVEC2F m_precalc_slope[4]
bool IsPointInside(const SFVEC2F &aPoint) const override
INTERSECTION_RESULT IsBBoxInside(const BBOX_2D &aBBox) const override
Test this object if it's completely outside, intersects, or is completely inside aBBox.
POLYGON_4PT_2D(const SFVEC2F &v1, const SFVEC2F &v2, const SFVEC2F &v3, const SFVEC2F &v4, const BOARD_ITEM &aBoardItem)
bool Overlaps(const BBOX_2D &aBBox) const override
Test if the box overlaps the object.
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.
void Union(const SFVEC2F &aPoint)
Recalculate the bounding box adding a point.
bool IsInitialized() const
Check if this bounding box is already initialized.
void Reset()
Reset the bounding box to zero and uninitialize it.
void ScaleNextUp()
Scale a bounding box to the next float representation making it larger.
bool IntersectSegment(const SFVEC2F &aStart, const SFVEC2F &aEnd_minus_start, float *aOutT) const