Real DistPoint2Segment2<Real>::GetSquared (Real t, const Vector2<Real>& velocity0, const Vector2<Real>& velocity1) { Vector2<Real> movedPoint = *mPoint + t*velocity0; Vector2<Real> movedCenter = mSegment->Center + t*velocity1; Segment2<Real> movedSegment(movedCenter, mSegment->Direction, mSegment->Extent); return DistPoint2Segment2<Real>(movedPoint, movedSegment).GetSquared(); }
Real DistLine2Segment2<Real>::GetSquared (Real t, const Vector2<Real>& velocity0, const Vector2<Real>& velocity1) { Vector2<Real> movedOrigin = mLine->Origin + t*velocity0; Vector2<Real> movedCenter = mSegment->Center + t*velocity1; Line2<Real> movedLine(movedOrigin, mLine->Direction); Segment2<Real> movedSegment(movedCenter, mSegment->Direction, mSegment->Extent); return DistLine2Segment2<Real>(movedLine, movedSegment).GetSquared(); }
Real DistSegment3Box3<Real>::GetSquared (Real t, const Vector3<Real>& velocity0, const Vector3<Real>& velocity1) { Vector3<Real> movedCenter0 = mSegment->Center + t*velocity0; Vector3<Real> movedCenter1 = mBox->Center + t*velocity1; Segment3<Real> movedSegment(movedCenter0, mSegment->Direction, mSegment->Extent); Box3<Real> movedBox(movedCenter1,mBox->Axis, mBox->Extent); return DistSegment3Box3<Real>(movedSegment, movedBox).GetSquared(); }
Real DistRay2Segment2<Real>::GetSquared (Real t, const Vector2<Real>& velocity0, const Vector2<Real>& velocity1) { Vector2<Real> movedOrigin = mRay->Origin + t*velocity0; Vector2<Real> movedCenter = mSegment->Center + t*velocity1; Ray2<Real> movedRay(movedOrigin, mRay->Direction); Segment2<Real> movedSegment(movedCenter, mSegment->Direction, mSegment->Extent); return DistRay2Segment2<Real>(movedRay, movedSegment).GetSquared(); }