コード例 #1
0
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();
}
コード例 #2
0
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();
}
コード例 #3
0
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();
}
コード例 #4
0
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();
}