35 wxASSERT( aRadius > 0.0f );
47 wxASSERT(
m_bbox.IsInitialized() );
73 const float qd = qx * aSegRay.
m_Dir.x + qy * aSegRay.
m_Dir.y;
74 const float qq = qx * qx + qy * qy;
81 if( discriminantsqr < FLT_EPSILON )
86 const float discriminant = sqrt( discriminantsqr );
87 const float t1 = ( -qd - discriminant );
88 const float t2 = ( -qd + discriminant );
91 if( ( t1 > 0.0f ) && ( t1 < aSegRay.
m_Length ) )
97 if( ( t2 > 0.0f ) && ( t2 < aSegRay.
m_Length ) )
103 wxASSERT( ( t > 0.0f ) && ( t <= aSegRay.
m_Length ) );
109 const SFVEC2F hitPoint = aSegRay.
at( t );
120 if( !
m_bbox.Intersects( aBBox ) )
132 s[0] = v[0].x * v[0].x + v[0].y * v[0].y;
133 s[1] = v[1].x * v[1].x + v[1].y * v[1].y;
134 s[2] = v[2].x * v[2].x + v[2].y * v[2].y;
135 s[3] = v[3].x * v[3].x + v[3].y * v[3].y;
145 if( isInside[0] && isInside[1] && isInside[2] && isInside[3] )
149 if( isInside[0] || isInside[1] || isInside[2] || isInside[3] )
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
bool Overlaps(const BBOX_2D &aBBox) const override
Test if the box overlaps the object.
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.
bool Intersects(const BBOX_2D &aBBox) const override
a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅)
bool Intersect(const RAYSEG2D &aSegRay, float *aOutT, SFVEC2F *aNormalOut) const override
FILLED_CIRCLE_2D(const SFVEC2F &aCenter, float aRadius, const BOARD_ITEM &aBoardItem)
OBJECT_2D(OBJECT_2D_TYPE aObjType, const BOARD_ITEM &aBoardItem)
Manage a bounding box defined by two SFVEC2F min max points.
bool Intersects(const BBOX_2D &aBBox) const
Test if a bounding box intersects this box.
const SFVEC2F & Min() const
const SFVEC2F & Max() const
SFVEC2F at(float t) const