示例#1
0
        // Token: 0x0600019F RID: 415 RVA: 0x000079D8 File Offset: 0x00005BD8
        public static Segment3 ShortestSegmentTo(this Segment3 segment3, AxisAlignedBox3 axisAlignedBox3)
        {
            Box3 box = new Box3(axisAlignedBox3.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox3.ExtentX, axisAlignedBox3.ExtentY, axisAlignedBox3.ExtentZ);
            DistanceSegment3Box3 distanceSegment3Box = new DistanceSegment3Box3(segment3, box);

            return(new Segment3(distanceSegment3Box.ClosestPointOnSegment, distanceSegment3Box.ClosestPointOnBox));
        }
示例#2
0
        // Token: 0x0600040F RID: 1039 RVA: 0x00012420 File Offset: 0x00010620
        public static bool Intersects(this Segment3 segment, AxisAlignedBox3 axisAlignedBox)
        {
            Box3 box = new Box3(axisAlignedBox.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox.ExtentX, axisAlignedBox.ExtentY, axisAlignedBox.ExtentZ);
            IntersectionSegment3Box3 intersectionSegment3Box = new IntersectionSegment3Box3(segment, box, true);

            return(intersectionSegment3Box.Test());
        }
        // Token: 0x0600023A RID: 570 RVA: 0x00009920 File Offset: 0x00007B20
        public DistanceVector3Segment3(Vector3 vector, Segment3 segment)
        {
            this = default(DistanceVector3Segment3);
            Vector3 vector2 = vector - segment.Origin;
            double  num     = segment.Direction.Dot(vector2);

            if (num > -segment.Extent)
            {
                if (num < segment.Extent)
                {
                    this.SegmentParameter      = num;
                    this.ClosestPointOnSegment = segment.Origin + num * segment.Direction;
                }
                else
                {
                    this.ClosestPointOnSegment = segment.PositiveEnd;
                    this.SegmentParameter      = segment.Extent;
                }
            }
            else
            {
                this.ClosestPointOnSegment = segment.NegativeEnd;
                this.SegmentParameter      = -segment.Extent;
            }
            this.ClosestPointOnVector = vector;
            this.SquaredDistance      = (this.ClosestPointOnSegment - this.ClosestPointOnVector).SquaredLength;
        }
示例#4
0
 // Token: 0x06000416 RID: 1046 RVA: 0x00012666 File Offset: 0x00010866
 public IntersectionSegment3Box3(Segment3 segment, Box3 box, bool solid)
 {
     this         = default(IntersectionSegment3Box3);
     this.segment = segment;
     this.box     = box;
     this.solid   = solid;
 }
示例#5
0
        // Token: 0x060001A8 RID: 424 RVA: 0x00007B9C File Offset: 0x00005D9C
        public DistanceSegment3Box3(Segment3 segment, Box3 box)
        {
            this = default(DistanceSegment3Box3);
            Line3             line             = new Line3(segment.Origin, segment.Direction);
            DistanceLine3Box3 distanceLine3Box = new DistanceLine3Box3(line, box);

            if (distanceLine3Box.LineParameter < -segment.Extent)
            {
                DistanceVector3Box3 distanceVector3Box = new DistanceVector3Box3(segment.NegativeEnd, box);
                this.SquaredDistance       = distanceVector3Box.SquaredDistance;
                this.ClosestPointOnSegment = distanceVector3Box.ClosestPointOnVector;
                this.ClosestPointOnBox     = distanceVector3Box.ClosestPointOnBox;
                return;
            }
            if (distanceLine3Box.LineParameter <= segment.Extent)
            {
                this.SquaredDistance       = distanceLine3Box.SquaredDistance;
                this.ClosestPointOnSegment = distanceLine3Box.ClosestPointOnLine;
                this.ClosestPointOnBox     = distanceLine3Box.ClosestPointOnBox;
                return;
            }
            DistanceVector3Box3 distanceVector3Box2 = new DistanceVector3Box3(segment.PositiveEnd, box);

            this.SquaredDistance       = distanceVector3Box2.SquaredDistance;
            this.ClosestPointOnSegment = distanceVector3Box2.ClosestPointOnVector;
            this.ClosestPointOnBox     = distanceVector3Box2.ClosestPointOnBox;
        }
示例#6
0
        // Token: 0x0600000B RID: 11 RVA: 0x00002204 File Offset: 0x00000404
        public static Vector3 ClosestPointTo(this AxisAlignedBox3 axisAlignedBox3, Segment3 segment)
        {
            Box3 box = new Box3(axisAlignedBox3.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox3.ExtentX, axisAlignedBox3.ExtentY, axisAlignedBox3.ExtentZ);
            DistanceSegment3Box3 distanceSegment3Box = new DistanceSegment3Box3(segment, box);

            return(distanceSegment3Box.ClosestPointOnBox);
        }
        // Token: 0x060004CA RID: 1226 RVA: 0x00018AA0 File Offset: 0x00016CA0
        public static Segment3 Transform(this AffineTransform3 transformer, Segment3 segment)
        {
            Vector3     origin    = transformer.Transform(segment.Origin);
            UnitVector3 direction = transformer.Transform(segment.Direction);

            return(new Segment3(origin, direction, transformer.Scale * segment.Extent));
        }
示例#8
0
        // Token: 0x0600019D RID: 413 RVA: 0x00007938 File Offset: 0x00005B38
        public static double DistanceTo(this Segment3 segment3, AxisAlignedBox3 axisAlignedBox3)
        {
            Box3 box = new Box3(axisAlignedBox3.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox3.ExtentX, axisAlignedBox3.ExtentY, axisAlignedBox3.ExtentZ);
            DistanceSegment3Box3 distanceSegment3Box = new DistanceSegment3Box3(segment3, box);

            return(distanceSegment3Box.Distance);
        }
        // Token: 0x060000E7 RID: 231 RVA: 0x000056A4 File Offset: 0x000038A4
        public DistanceLine3Segment3(Line3 line, Segment3 segment)
        {
            this = default(DistanceLine3Segment3);
            Vector3 vector        = line.Origin - segment.Origin;
            double  num           = -line.Direction.Dot(segment.Direction);
            double  num2          = vector.Dot(line.Direction);
            double  squaredLength = vector.SquaredLength;
            double  num3          = 1.0;
            double  num4          = num;
            double  num5          = Math.Abs(num3 - num4 * num4);
            double  num7;
            double  num10;
            double  value;

            if (num5 >= 1E-08)
            {
                double num6 = -vector.Dot(segment.Direction);
                num7 = num * num2 - num6;
                double num8 = segment.Extent * num5;
                if (num7 >= -num8)
                {
                    if (num7 <= num8)
                    {
                        double num9 = 1.0 / num5;
                        num10 = (num * num6 - num2) * num9;
                        num7 *= num9;
                        double num11 = num10;
                        value = num11 * (num11 + num * num7 + 2.0 * num2) + num7 * (num * num10 + num7 + 2.0 * num6) + squaredLength;
                    }
                    else
                    {
                        num7  = segment.Extent;
                        num10 = -(num * num7 + num2);
                        double num12 = -num10 * num10;
                        double num13 = num7;
                        value = num12 + num13 * (num13 + 2.0 * num6) + squaredLength;
                    }
                }
                else
                {
                    num7  = -segment.Extent;
                    num10 = -(num * num7 + num2);
                    double num14 = -num10 * num10;
                    double num15 = num7;
                    value = num14 + num15 * (num15 + 2.0 * num6) + squaredLength;
                }
            }
            else
            {
                num7  = 0.0;
                num10 = -num2;
                value = num2 * num10 + squaredLength;
            }
            this.ClosestPointOnLine    = line.Origin + num10 * line.Direction;
            this.ClosestPointOnSegment = segment.Origin + num7 * segment.Direction;
            this.LineParameter         = num10;
            this.SegmentParameter      = num7;
            this.SquaredDistance       = Math.Abs(value);
        }
示例#10
0
        // Token: 0x06000415 RID: 1045 RVA: 0x00012610 File Offset: 0x00010810
        public static Vector3?IntersectionWith(this Segment3 segment, Triangle3 triangle)
        {
            IntersectionSegment3Triangle3 intersectionSegment3Triangle = new IntersectionSegment3Triangle3(segment, triangle);

            if (intersectionSegment3Triangle.Find() && intersectionSegment3Triangle.IntersectionType != Intersection.Type.IT_EMPTY)
            {
                return(new Vector3?(segment.Origin + intersectionSegment3Triangle.SegmentParameter * segment.Direction));
            }
            return(null);
        }
示例#11
0
        // Token: 0x0600048B RID: 1163 RVA: 0x00016B20 File Offset: 0x00014D20
        public static AxisAlignedBox3 ComputeAxisAlignedBoundingBox(this Segment3 segment)
        {
            double minX = Math.Min(segment.NegativeEnd.X, segment.PositiveEnd.X);
            double minY = Math.Min(segment.NegativeEnd.Y, segment.PositiveEnd.Y);
            double minZ = Math.Min(segment.NegativeEnd.Z, segment.PositiveEnd.Z);
            double maxX = Math.Max(segment.NegativeEnd.X, segment.PositiveEnd.X);
            double maxY = Math.Max(segment.NegativeEnd.Y, segment.PositiveEnd.Y);
            double maxZ = Math.Max(segment.NegativeEnd.Z, segment.PositiveEnd.Z);

            return(new AxisAlignedBox3(minX, maxX, minY, maxY, minZ, maxZ));
        }
示例#12
0
        // Token: 0x0600040A RID: 1034 RVA: 0x0001228C File Offset: 0x0001048C
        public static Segment3?IntersectionWith(this Segment3 segment, Cylinder3 cylinder)
        {
            IntersectionSegment3Cylinder3 intersectionSegment3Cylinder = new IntersectionSegment3Cylinder3(segment, cylinder);

            intersectionSegment3Cylinder.Find();
            if (intersectionSegment3Cylinder.IntersectionType == Intersection.Type.IT_SEGMENT)
            {
                return(new Segment3?(new Segment3(intersectionSegment3Cylinder.Point0, intersectionSegment3Cylinder.Point1)));
            }
            if (intersectionSegment3Cylinder.IntersectionType == Intersection.Type.IT_POINT)
            {
                return(new Segment3?(new Segment3(intersectionSegment3Cylinder.Point0, intersectionSegment3Cylinder.Point0)));
            }
            return(null);
        }
示例#13
0
        // Token: 0x060001F6 RID: 502 RVA: 0x00008F28 File Offset: 0x00007128
        public DistanceTriangle3Triangle3(Triangle3 triangle0, Triangle3 triangle1)
        {
            this = default(DistanceTriangle3Triangle3);
            double num   = double.MaxValue;
            int    index = 2;
            int    i     = 0;

            while (i < 3)
            {
                Segment3 segment = new Segment3(triangle0[index], triangle0[i]);
                DistanceSegment3Triangle3 distanceSegment3Triangle = new DistanceSegment3Triangle3(segment, triangle1);
                double squaredDistance = distanceSegment3Triangle.SquaredDistance;
                if (squaredDistance < num)
                {
                    this.ClosestPoint0 = distanceSegment3Triangle.ClosestPointOnSegment;
                    this.ClosestPoint1 = distanceSegment3Triangle.ClosestPointOnTriangle;
                    num = squaredDistance;
                    if (num <= 1E-08)
                    {
                        this.SquaredDistance = 0.0;
                        return;
                    }
                }
                index = i++;
            }
            int index2 = 2;
            int j      = 0;

            while (j < 3)
            {
                Segment3 segment2 = new Segment3(triangle1[index2], triangle1[j]);
                DistanceSegment3Triangle3 distanceSegment3Triangle2 = new DistanceSegment3Triangle3(segment2, triangle0);
                double squaredDistance = distanceSegment3Triangle2.SquaredDistance;
                if (squaredDistance < num)
                {
                    this.ClosestPoint0 = distanceSegment3Triangle2.ClosestPointOnTriangle;
                    this.ClosestPoint1 = distanceSegment3Triangle2.ClosestPointOnSegment;
                    num = squaredDistance;
                    if (num <= 1E-08)
                    {
                        this.SquaredDistance = 0.0;
                        return;
                    }
                }
                index2 = j++;
            }
            this.SquaredDistance = num;
        }
示例#14
0
        // Token: 0x06000026 RID: 38 RVA: 0x000027A8 File Offset: 0x000009A8
        public static Vector3 ClosestPointTo(this Arc3 arc3, Segment3 segment3)
        {
            Line3             line             = new Line3(segment3.NegativeEnd, segment3.Direction);
            DistanceLine3Arc3 distanceLine3Arc = new DistanceLine3Arc3(line, arc3);

            if (distanceLine3Arc.LineParameter < 0.0)
            {
                return(arc3.ClosestPointTo(segment3.NegativeEnd));
            }
            Line3             line2             = new Line3(segment3.PositiveEnd, -segment3.Direction);
            DistanceLine3Arc3 distanceLine3Arc2 = new DistanceLine3Arc3(line2, arc3);

            if (distanceLine3Arc2.LineParameter < 0.0)
            {
                return(arc3.ClosestPointTo(segment3.PositiveEnd));
            }
            return(distanceLine3Arc2.ClosestPointOnArc);
        }
示例#15
0
 // Token: 0x06000183 RID: 387 RVA: 0x000074D8 File Offset: 0x000056D8
 public DistanceRectangle3Rectangle3(Rectangle3 rectangle0, Rectangle3 rectangle1)
 {
     this = default(DistanceRectangle3Rectangle3);
     this.SquaredDistance = double.MaxValue;
     for (int i = 0; i < 2; i++)
     {
         for (int j = -1; j <= 1; j += 2)
         {
             double      num       = (i == 0) ? rectangle0.Extent1 : rectangle0.Extent0;
             UnitVector3 vector    = (i == 0) ? rectangle0.Axis1 : rectangle0.Axis0;
             Vector3     origin    = rectangle0.Center + (double)j * num * vector;
             UnitVector3 direction = (i == 0) ? rectangle0.Axis0 : rectangle0.Axis1;
             double      extent    = (i == 0) ? rectangle0.Extent0 : rectangle0.Extent1;
             Segment3    segment   = new Segment3(origin, direction, extent);
             DistanceSegment3Rectangle3 distanceSegment3Rectangle = new DistanceSegment3Rectangle3(segment, rectangle1);
             if (distanceSegment3Rectangle.SquaredDistance < this.SquaredDistance)
             {
                 this.ClosestPoint0   = distanceSegment3Rectangle.ClosestPointOnSegment;
                 this.ClosestPoint1   = distanceSegment3Rectangle.ClosestPointOnRectangle;
                 this.SquaredDistance = distanceSegment3Rectangle.SquaredDistance;
             }
         }
     }
     for (int i = 0; i < 2; i++)
     {
         for (int j = -1; j <= 1; j += 2)
         {
             double      num2       = (i == 0) ? rectangle1.Extent1 : rectangle1.Extent0;
             UnitVector3 vector2    = (i == 0) ? rectangle1.Axis1 : rectangle1.Axis0;
             Vector3     origin2    = rectangle1.Center + (double)j * num2 * vector2;
             UnitVector3 direction2 = (i == 0) ? rectangle1.Axis0 : rectangle1.Axis1;
             double      extent2    = (i == 0) ? rectangle1.Extent0 : rectangle1.Extent1;
             Segment3    segment2   = new Segment3(origin2, direction2, extent2);
             DistanceSegment3Rectangle3 distanceSegment3Rectangle2 = new DistanceSegment3Rectangle3(segment2, rectangle0);
             if (distanceSegment3Rectangle2.SquaredDistance < this.SquaredDistance)
             {
                 this.ClosestPoint0   = distanceSegment3Rectangle2.ClosestPointOnRectangle;
                 this.ClosestPoint1   = distanceSegment3Rectangle2.ClosestPointOnSegment;
                 this.SquaredDistance = distanceSegment3Rectangle2.SquaredDistance;
             }
         }
     }
 }
示例#16
0
        // Token: 0x06000056 RID: 86 RVA: 0x00003064 File Offset: 0x00001264
        public DistancePlane3Segment3(Plane3 plane, Segment3 segment)
        {
            this = default(DistancePlane3Segment3);
            DistanceVector3Plane3 distanceVector3Plane  = new DistanceVector3Plane3(segment.NegativeEnd, plane);
            DistanceVector3Plane3 distanceVector3Plane2 = new DistanceVector3Plane3(segment.PositiveEnd, plane);
            double signedDistance  = distanceVector3Plane.SignedDistance;
            double signedDistance2 = distanceVector3Plane2.SignedDistance;

            if (signedDistance > 0.0 && signedDistance2 > 0.0)
            {
                this.SignedDistance = Math.Min(signedDistance, signedDistance2);
                return;
            }
            if (signedDistance < 0.0 && signedDistance2 < 0.0)
            {
                this.SignedDistance = Math.Max(signedDistance, signedDistance2);
                return;
            }
            this.SignedDistance = 0.0;
        }
        // Token: 0x060001EE RID: 494 RVA: 0x00008D90 File Offset: 0x00006F90
        public DistanceTriangle3Rectangle3(Triangle3 triangle, Rectangle3 rectangle)
        {
            this = default(DistanceTriangle3Rectangle3);
            double num = double.MaxValue;
            int    i   = 2;
            int    j   = 0;

            while (j < 3)
            {
                Segment3 segment = new Segment3(triangle[i], triangle[j]);
                DistanceSegment3Rectangle3 distanceSegment3Rectangle = new DistanceSegment3Rectangle3(segment, rectangle);
                if (distanceSegment3Rectangle.SquaredDistance < num)
                {
                    this.ClosestPointOnTriangle  = distanceSegment3Rectangle.ClosestPointOnSegment;
                    this.ClosestPointOnRectangle = distanceSegment3Rectangle.ClosestPointOnRectangle;
                    num = distanceSegment3Rectangle.SquaredDistance;
                }
                i = j++;
            }
            for (j = 0; j < 2; j++)
            {
                for (i = -1; i <= 1; i += 2)
                {
                    double      num2      = (j == 0) ? rectangle.Extent1 : rectangle.Extent0;
                    UnitVector3 vector    = (j == 0) ? rectangle.Axis1 : rectangle.Axis0;
                    Vector3     origin    = rectangle.Center + (double)i * num2 * vector;
                    UnitVector3 direction = (j == 0) ? rectangle.Axis0 : rectangle.Axis1;
                    double      extent    = (j == 0) ? rectangle.Extent0 : rectangle.Extent1;
                    Segment3    segment2  = new Segment3(origin, direction, extent);
                    DistanceSegment3Triangle3 distanceSegment3Triangle = new DistanceSegment3Triangle3(segment2, triangle);
                    if (distanceSegment3Triangle.SquaredDistance < num)
                    {
                        this.ClosestPointOnTriangle  = distanceSegment3Triangle.ClosestPointOnTriangle;
                        this.ClosestPointOnRectangle = distanceSegment3Triangle.ClosestPointOnSegment;
                        num = distanceSegment3Triangle.SquaredDistance;
                    }
                }
            }
            this.SquaredDistance = num;
        }
示例#18
0
        // Token: 0x060001CA RID: 458 RVA: 0x00008918 File Offset: 0x00006B18
        public DistanceSegment3Triangle3(Segment3 segment, Triangle3 triangle)
        {
            this = default(DistanceSegment3Triangle3);
            Line3 line = new Line3(segment.Origin, segment.Direction);
            DistanceLine3Triangle3 distanceLine3Triangle = new DistanceLine3Triangle3(line, triangle);

            if (distanceLine3Triangle.LineParameter < -segment.Extent)
            {
                DistanceVector3Triangle3 distanceVector3Triangle = new DistanceVector3Triangle3(segment.NegativeEnd, triangle);
                this.SquaredDistance        = distanceVector3Triangle.SquaredDistance;
                this.ClosestPointOnSegment  = segment.NegativeEnd;
                this.ClosestPointOnTriangle = distanceVector3Triangle.ClosestPointOnTriangle;
                this.SegmentParameter       = -segment.Extent;
                this.TriangleBary0          = distanceVector3Triangle.TriangleBary0;
                this.TriangleBary1          = distanceVector3Triangle.TriangleBary1;
                this.TriangleBary2          = distanceVector3Triangle.TriangleBary2;
                return;
            }
            if (distanceLine3Triangle.LineParameter <= segment.Extent)
            {
                this.SquaredDistance        = distanceLine3Triangle.SquaredDistance;
                this.ClosestPointOnSegment  = distanceLine3Triangle.ClosestPointOnLine;
                this.ClosestPointOnTriangle = distanceLine3Triangle.ClosestPointOnTriangle;
                this.SegmentParameter       = distanceLine3Triangle.LineParameter;
                this.TriangleBary0          = distanceLine3Triangle.TriangleBary0;
                this.TriangleBary1          = distanceLine3Triangle.TriangleBary1;
                this.TriangleBary2          = distanceLine3Triangle.TriangleBary2;
                return;
            }
            DistanceVector3Triangle3 distanceVector3Triangle2 = new DistanceVector3Triangle3(segment.PositiveEnd, triangle);

            this.SquaredDistance        = distanceVector3Triangle2.SquaredDistance;
            this.ClosestPointOnSegment  = segment.PositiveEnd;
            this.ClosestPointOnTriangle = distanceVector3Triangle2.ClosestPointOnTriangle;
            this.SegmentParameter       = segment.Extent;
            this.TriangleBary0          = distanceVector3Triangle2.TriangleBary0;
            this.TriangleBary1          = distanceVector3Triangle2.TriangleBary1;
            this.TriangleBary2          = distanceVector3Triangle2.TriangleBary2;
        }
示例#19
0
        // Token: 0x060003BD RID: 957 RVA: 0x00010B94 File Offset: 0x0000ED94
        public static ICollection <Vector3> IntersectionPointsWith(this Ray3 ray, Cylinder3 cylinder)
        {
            Segment3?segment = ray.IntersectionWith(cylinder);

            if (segment == null)
            {
                return(new List <Vector3>());
            }
            Segment3 value = segment.Value;

            if (value.Extent < 1E-08)
            {
                return(new List <Vector3>
                {
                    value.Origin
                });
            }
            return(new List <Vector3>
            {
                value.NegativeEnd,
                value.PositiveEnd
            });
        }
示例#20
0
        // Token: 0x06000368 RID: 872 RVA: 0x0000EA8C File Offset: 0x0000CC8C
        public static ICollection <Vector3> IntersectionPointsWith(this Line3 line, Box3 box)
        {
            Segment3?segment = line.IntersectionWith(box);

            if (segment == null)
            {
                return(new List <Vector3>());
            }
            Segment3 value = segment.Value;

            if (value.Extent < 1E-08)
            {
                return(new List <Vector3>
                {
                    value.Origin
                });
            }
            return(new List <Vector3>
            {
                value.NegativeEnd,
                value.PositiveEnd
            });
        }
示例#21
0
        // Token: 0x060001B0 RID: 432 RVA: 0x00007CC4 File Offset: 0x00005EC4
        public DistanceSegment3Rectangle3(Segment3 segment, Rectangle3 rectangle)
        {
            this = default(DistanceSegment3Rectangle3);
            Line3 line = new Line3(segment.Origin, segment.Direction);
            DistanceLine3Rectangle3 distanceLine3Rectangle = new DistanceLine3Rectangle3(line, rectangle);

            if (distanceLine3Rectangle.LineParameter < -segment.Extent)
            {
                DistanceVector3Rectangle3 distanceVector3Rectangle = new DistanceVector3Rectangle3(segment.NegativeEnd, rectangle);
                this.SquaredDistance         = distanceVector3Rectangle.SquaredDistance;
                this.ClosestPointOnSegment   = segment.NegativeEnd;
                this.ClosestPointOnRectangle = distanceVector3Rectangle.ClosestPointOnRectangle;
                this.SegmentParameter        = -segment.Extent;
                this.RectCoord0 = distanceVector3Rectangle.RectCoord0;
                this.RectCoord1 = distanceVector3Rectangle.RectCoord1;
                return;
            }
            if (distanceLine3Rectangle.LineParameter <= segment.Extent)
            {
                this.SquaredDistance         = distanceLine3Rectangle.SquaredDistance;
                this.ClosestPointOnSegment   = distanceLine3Rectangle.ClosestPointOnLine;
                this.ClosestPointOnRectangle = distanceLine3Rectangle.ClosestPointOnRectangle;
                this.SegmentParameter        = distanceLine3Rectangle.LineParameter;
                this.RectCoord0 = distanceLine3Rectangle.RectCoord0;
                this.RectCoord1 = distanceLine3Rectangle.RectCoord1;
                return;
            }
            DistanceVector3Rectangle3 distanceVector3Rectangle2 = new DistanceVector3Rectangle3(segment.PositiveEnd, rectangle);

            this.SquaredDistance         = distanceVector3Rectangle2.SquaredDistance;
            this.ClosestPointOnSegment   = segment.PositiveEnd;
            this.ClosestPointOnRectangle = distanceVector3Rectangle2.ClosestPointOnRectangle;
            this.SegmentParameter        = segment.Extent;
            this.RectCoord0 = distanceVector3Rectangle2.RectCoord0;
            this.RectCoord1 = distanceVector3Rectangle2.RectCoord1;
        }
示例#22
0
        // Token: 0x060003C9 RID: 969 RVA: 0x00010EC0 File Offset: 0x0000F0C0
        public static ICollection <Vector3> IntersectionPointsWith(this Ray3 ray, AxisAlignedBox3 axisAlignedBox)
        {
            Box3     box     = new Box3(axisAlignedBox.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox.ExtentX, axisAlignedBox.ExtentY, axisAlignedBox.ExtentZ);
            Segment3?segment = ray.IntersectionWith(box);

            if (segment == null)
            {
                return(new List <Vector3>());
            }
            Segment3 value = segment.Value;

            if (value.Extent < 1E-08)
            {
                return(new List <Vector3>
                {
                    value.Origin
                });
            }
            return(new List <Vector3>
            {
                value.NegativeEnd,
                value.PositiveEnd
            });
        }
示例#23
0
        // Token: 0x06000209 RID: 521 RVA: 0x000092B0 File Offset: 0x000074B0
        public static Segment3 ShortestSegmentTo(this Vector3 vector3, Segment3 segment3)
        {
            DistanceVector3Segment3 distanceVector3Segment = new DistanceVector3Segment3(vector3, segment3);

            return(new Segment3(distanceVector3Segment.ClosestPointOnVector, distanceVector3Segment.ClosestPointOnSegment));
        }
示例#24
0
        // Token: 0x06000208 RID: 520 RVA: 0x00009290 File Offset: 0x00007490
        public static double DistanceTo(this Vector3 vector3, Segment3 segment3)
        {
            DistanceVector3Segment3 distanceVector3Segment = new DistanceVector3Segment3(vector3, segment3);

            return(distanceVector3Segment.Distance);
        }
示例#25
0
        // Token: 0x0600009A RID: 154 RVA: 0x00003AFC File Offset: 0x00001CFC
        public static Segment3 ShortestSegmentTo(this Line3 line3, Segment3 segment3)
        {
            DistanceLine3Segment3 distanceLine3Segment = new DistanceLine3Segment3(line3, segment3);

            return(new Segment3(distanceLine3Segment.ClosestPointOnLine, distanceLine3Segment.ClosestPointOnSegment));
        }
示例#26
0
        // Token: 0x06000099 RID: 153 RVA: 0x00003ADC File Offset: 0x00001CDC
        public static Vector3 ClosestPointTo(this Line3 line3, Segment3 segment3)
        {
            DistanceLine3Segment3 distanceLine3Segment = new DistanceLine3Segment3(line3, segment3);

            return(distanceLine3Segment.ClosestPointOnLine);
        }
示例#27
0
        // Token: 0x06000098 RID: 152 RVA: 0x00003ABC File Offset: 0x00001CBC
        public static double DistanceTo(this Line3 line3, Segment3 segment3)
        {
            DistanceLine3Segment3 distanceLine3Segment = new DistanceLine3Segment3(line3, segment3);

            return(distanceLine3Segment.Distance);
        }
示例#28
0
 // Token: 0x06000335 RID: 821 RVA: 0x0000D17E File Offset: 0x0000B37E
 public static ICollection <Vector3> IntersectionPointsWith(this Box3 box3, Segment3 segment3)
 {
     return(segment3.IntersectionPointsWith(box3));
 }
示例#29
0
 // Token: 0x06000334 RID: 820 RVA: 0x0000D175 File Offset: 0x0000B375
 public static Segment3?IntersectionWith(this Box3 box3, Segment3 segment3)
 {
     return(segment3.IntersectionWith(box3));
 }
示例#30
0
 // Token: 0x06000333 RID: 819 RVA: 0x0000D16C File Offset: 0x0000B36C
 public static bool Intersects(this Box3 box3, Segment3 segment3)
 {
     return(segment3.Intersects(box3));
 }