Beispiel #1
0
Real DistPoint2Box2<Real>::GetSquared (Real t,
    const Vector2<Real>& velocity0, const Vector2<Real>& velocity1)
{
    Vector2<Real> movedPoint = *mPoint + t*velocity0;
    Vector2<Real> movedCenter = mBox->Center + t*velocity1;
    Box2<Real> movedBox(movedCenter, mBox->Axis, mBox->Extent);
    return DistPoint2Box2<Real>(movedPoint, movedBox).GetSquared();
}
Beispiel #2
0
Real DistRay3Box3<Real>::GetSquared (Real t,
    const Vector3<Real>& velocity0, const Vector3<Real>& velocity1)
{
    Vector3<Real> movedOrigin = mRay->Origin + t*velocity0;
    Vector3<Real> movedCenter = mBox->Center + t*velocity1;
    Ray3<Real> movedRay(movedOrigin, mRay->Direction);
    Box3<Real> movedBox(movedCenter, mBox->Axis, mBox->Extent);
    return DistRay3Box3<Real>(movedRay, movedBox).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();
}