Real DistPoint3Rectangle3<Real>::GetSquared (Real t, const Vector3<Real>& velocity0, const Vector3<Real>& velocity1) { Vector3<Real> movedPoint = *mPoint + t*velocity0; Vector3<Real> movedCenter = mRectangle->Center + t*velocity1; Rectangle3<Real> movedRectangle(movedCenter, mRectangle->Axis[0], mRectangle->Axis[1], mRectangle->Extent[0], mRectangle->Extent[1]); return DistPoint3Rectangle3<Real>(movedPoint,movedRectangle).GetSquared(); }
Real DistRay3Rectangle3<Real>::GetSquared (Real t, const Vector3<Real>& velocity0, const Vector3<Real>& velocity1) { Vector3<Real> movedOrigin = mRay->Origin + t*velocity0; Vector3<Real> movedCenter = mRectangle->Center + t*velocity1; Ray3<Real> movedRay(movedOrigin, mRay->Direction); Rectangle3<Real> movedRectangle(movedCenter, mRectangle->Axis, mRectangle->Extent); return DistRay3Rectangle3<Real>(movedRay, movedRectangle).GetSquared(); }
Real DistLine3Rectangle3<Real>::Get ( Real t, const Vector3<Real>& velocity0, const Vector3<Real>& velocity1 ) { Vector3<Real> movedOrigin = mLine->Origin + t * velocity0; Vector3<Real> movedCenter = mRectangle->Center + t * velocity1; Line3<Real> movedLine( movedOrigin, mLine->Direction ); Rectangle3<Real> movedRectangle( movedCenter, mRectangle->Axis, mRectangle->Extent ); return DistLine3Rectangle3<Real>( movedLine, movedRectangle ).Get(); }