コード例 #1
0
Real DistRay2Segment2<Real>::Get (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).Get();
}
コード例 #2
0
 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();
 }
コード例 #3
0
Real DistRay3Triangle3<Real>::GetSquared (Real t,
    const Vector3<Real>& velocity0, const Vector3<Real>& velocity1)
{
    Vector3<Real> movedOrigin = mRay->Origin + t*velocity0;
    Vector3<Real> movedV0 = mTriangle->V[0] + t*velocity1;
    Vector3<Real> movedV1 = mTriangle->V[1] + t*velocity1;
    Vector3<Real> movedV2 = mTriangle->V[2] + t*velocity1;
    Ray3<Real> movedRay(movedOrigin, mRay->Direction);
    Triangle3<Real> movedTriangle(movedV0, movedV1, movedV2);
    return DistRay3Triangle3<Real>(movedRay, movedTriangle).GetSquared();
}