示例#1
0
 // Token: 0x060003AE RID: 942 RVA: 0x000101AA File Offset: 0x0000E3AA
 public IntersectionPlane3Triangle3(Plane3 plane, Triangle3 triangle, double epsilon)
 {
     this          = default(IntersectionPlane3Triangle3);
     this.plane    = plane;
     this.triangle = triangle;
     if (epsilon >= 0.0)
     {
         this.epsilon = epsilon;
         return;
     }
     this.epsilon = 0.0;
 }
示例#2
0
        // Token: 0x06000052 RID: 82 RVA: 0x00002FBC File Offset: 0x000011BC
        public DistancePlane3Ray3(Plane3 plane, Ray3 ray)
        {
            this = default(DistancePlane3Ray3);
            DistanceVector3Plane3 distanceVector3Plane = new DistanceVector3Plane3(ray.Origin, plane);
            double signedDistance = distanceVector3Plane.SignedDistance;
            double num            = ray.Direction.Dot(plane.Normal);

            if ((signedDistance > 0.0 && num > -1E-08) || (signedDistance < 0.0 && num < 1E-08))
            {
                this.SignedDistance = signedDistance;
                return;
            }
            this.SignedDistance = 0.0;
        }
示例#3
0
        // Token: 0x0600039A RID: 922 RVA: 0x0000FC34 File Offset: 0x0000DE34
        public static Segment3?IntersectionWith(this Plane3 plane, Triangle3 triangle)
        {
            IntersectionPlane3Triangle3 intersectionPlane3Triangle = new IntersectionPlane3Triangle3(plane, triangle, 0.0);
            bool flag = intersectionPlane3Triangle.Find();

            if (flag && intersectionPlane3Triangle.IntersectionType == Intersection.Type.IT_SEGMENT)
            {
                return(new Segment3?(new Segment3(intersectionPlane3Triangle.Point0, intersectionPlane3Triangle.Point1)));
            }
            if (flag && intersectionPlane3Triangle.IntersectionType == Intersection.Type.IT_POINT)
            {
                return(new Segment3?(new Segment3(intersectionPlane3Triangle.Point0, intersectionPlane3Triangle.Point0)));
            }
            return(null);
        }
示例#4
0
        // Token: 0x0600039B RID: 923 RVA: 0x0000FCB0 File Offset: 0x0000DEB0
        public static ICollection <Vector3> IntersectionPointsWith(this Plane3 plane, Triangle3 triangle)
        {
            IntersectionPlane3Triangle3 intersectionPlane3Triangle = new IntersectionPlane3Triangle3(plane, triangle, 0.0);

            intersectionPlane3Triangle.Find();
            List <Vector3> list = new List <Vector3>();

            Vector3[] array = new Vector3[]
            {
                intersectionPlane3Triangle.Point0,
                intersectionPlane3Triangle.Point1,
                intersectionPlane3Triangle.Point2
            };
            for (int i = 0; i < intersectionPlane3Triangle.Quantity; i++)
            {
                list.Add(array[i]);
            }
            return(list);
        }
示例#5
0
        // Token: 0x06000044 RID: 68 RVA: 0x00002C9C File Offset: 0x00000E9C
        public DistancePlane3Arc3(Plane3 plane, Arc3 arc)
        {
            this = default(DistancePlane3Arc3);
            double num  = arc.StartPoint.SignedDistanceTo(plane);
            double num2 = arc.EndPoint.SignedDistanceTo(plane);

            if (Math.Sign(num) != Math.Sign(num2))
            {
                this.SignedDistance = 0.0;
                return;
            }
            DistancePlane3Circle3 distancePlane3Circle = new DistancePlane3Circle3(plane, arc.Circle);
            double  signedDistance       = distancePlane3Circle.SignedDistance;
            Vector3 closestPointOnCircle = distancePlane3Circle.ClosestPointOnCircle;
            bool    flag = arc.Contains(arc.Circle.GetPointDirectionAngle(closestPointOnCircle));

            if (signedDistance != 0.0)
            {
                if (flag)
                {
                    this.SignedDistance = signedDistance;
                    return;
                }
                this.SignedDistance = ((num > 0.0) ? Math.Min(num, num2) : Math.Max(num, num2));
                return;
            }
            else
            {
                if (Math.Sign(arc.Circle.Center.SignedDistanceTo(plane)) != Math.Sign(num))
                {
                    this.SignedDistance = ((num > 0.0) ? Math.Min(num, num2) : Math.Max(num, num2));
                    return;
                }
                if (flag)
                {
                    this.SignedDistance = 0.0;
                    return;
                }
                this.SignedDistance = ((num > 0.0) ? Math.Min(num, num2) : Math.Max(num, num2));
                return;
            }
        }
示例#6
0
        // Token: 0x0600027E RID: 638 RVA: 0x0000A7C4 File Offset: 0x000089C4
        public bool Test()
        {
            Plane3 plane = new Plane3(this.circle.Normal, this.circle.Center);
            IntersectionPlane3Plane3 intersectionPlane3Plane = new IntersectionPlane3Plane3(this.plane, plane);

            if (!intersectionPlane3Plane.Find())
            {
                return(false);
            }
            if (intersectionPlane3Plane.IntersectionType == Intersection.Type.IT_PLANE)
            {
                return(true);
            }
            Line3   intersectionLine = intersectionPlane3Plane.IntersectionLine;
            Vector3 vector           = intersectionLine.Origin - this.circle.Center;
            double  num  = vector.Dot(intersectionLine.Direction);
            double  num2 = vector.SquaredLength - this.circle.Radius * this.circle.Radius;

            return(num * num - num2 * 1.0 >= 0.0);
        }
示例#7
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;
        }
示例#8
0
        // Token: 0x0600027F RID: 639 RVA: 0x0000A894 File Offset: 0x00008A94
        public ICollection <Vector3> Find()
        {
            Plane3 plane = new Plane3(this.circle.Normal, this.circle.Center);
            IntersectionPlane3Plane3 intersectionPlane3Plane = new IntersectionPlane3Plane3(this.plane, plane);

            if (!intersectionPlane3Plane.Find())
            {
                return(new Vector3[0]);
            }
            if (intersectionPlane3Plane.IntersectionType == Intersection.Type.IT_PLANE)
            {
                return(new Vector3[0]);
            }
            Line3   intersectionLine = intersectionPlane3Plane.IntersectionLine;
            Vector3 vector           = intersectionLine.Origin - this.circle.Center;
            double  num  = vector.Dot(intersectionLine.Direction);
            double  num2 = vector.SquaredLength - this.circle.Radius * this.circle.Radius;
            double  num3 = num;
            double  num4 = num3 * num3 - num2 * 1.0;

            if (num4 < 0.0)
            {
                return(new Vector3[0]);
            }
            double num5 = 1.0;

            if (num4 < 1E-08)
            {
                return(new Vector3[]
                {
                    intersectionLine.Origin - num * num5 * intersectionLine.Direction
                });
            }
            double num6 = Math.Sqrt(num4);

            return(new Vector3[]
            {
                intersectionLine.Origin - (num + num6) * num5 * intersectionLine.Direction,
                intersectionLine.Origin - (num - num6) * num5 * intersectionLine.Direction
            });
        }
        // Token: 0x0600005E RID: 94 RVA: 0x00003258 File Offset: 0x00001458
        public DistancePlane3Triangle3(Plane3 plane, Triangle3 triangle)
        {
            this = default(DistancePlane3Triangle3);
            DistanceVector3Plane3 distanceVector3Plane  = new DistanceVector3Plane3(triangle.V0, plane);
            DistanceVector3Plane3 distanceVector3Plane2 = new DistanceVector3Plane3(triangle.V1, plane);
            DistanceVector3Plane3 distanceVector3Plane3 = new DistanceVector3Plane3(triangle.V2, plane);
            double signedDistance  = distanceVector3Plane.SignedDistance;
            double signedDistance2 = distanceVector3Plane2.SignedDistance;
            double signedDistance3 = distanceVector3Plane3.SignedDistance;

            if (signedDistance > 0.0 && signedDistance2 > 0.0 && signedDistance3 > 0.0)
            {
                this.SignedDistance = Math.Min(signedDistance, Math.Min(signedDistance2, signedDistance3));
                return;
            }
            if (signedDistance < 0.0 && signedDistance2 < 0.0 && signedDistance3 < 0.0)
            {
                this.SignedDistance = Math.Max(signedDistance, Math.Max(signedDistance2, signedDistance3));
                return;
            }
            this.SignedDistance = 0.0;
        }
示例#10
0
        // Token: 0x0600005A RID: 90 RVA: 0x00003120 File Offset: 0x00001320
        public DistancePlane3Rectangle3(Plane3 plane, Rectangle3 rectangle)
        {
            this = default(DistancePlane3Rectangle3);
            DistanceVector3Plane3 distanceVector3Plane  = new DistanceVector3Plane3(rectangle.MMCorner, plane);
            DistanceVector3Plane3 distanceVector3Plane2 = new DistanceVector3Plane3(rectangle.MPCorner, plane);
            DistanceVector3Plane3 distanceVector3Plane3 = new DistanceVector3Plane3(rectangle.PMCorner, plane);
            DistanceVector3Plane3 distanceVector3Plane4 = new DistanceVector3Plane3(rectangle.PPCorner, plane);
            double signedDistance  = distanceVector3Plane.SignedDistance;
            double signedDistance2 = distanceVector3Plane2.SignedDistance;
            double signedDistance3 = distanceVector3Plane3.SignedDistance;
            double signedDistance4 = distanceVector3Plane4.SignedDistance;

            if (signedDistance > 0.0 && signedDistance2 > 0.0 && signedDistance3 > 0.0 && signedDistance4 > 0.0)
            {
                this.SignedDistance = Math.Min(signedDistance, Math.Min(signedDistance2, Math.Min(signedDistance3, signedDistance4)));
                return;
            }
            if (signedDistance < 0.0 && signedDistance2 < 0.0 && signedDistance3 < 0.0)
            {
                this.SignedDistance = Math.Max(signedDistance, Math.Max(signedDistance2, Math.Max(signedDistance3, signedDistance4)));
                return;
            }
            this.SignedDistance = 0.0;
        }
示例#11
0
        // Token: 0x06000468 RID: 1128 RVA: 0x000147E8 File Offset: 0x000129E8
        private bool ContainsPoint(Triangle3 triangle, Plane3 plane, Vector3 point)
        {
            AffineTransform3 affineTransform = Transform3Factory.CreateOrthonormalBasis(plane.Normal);
            UnitVector3      axisX           = affineTransform.AxisX;
            UnitVector3      axisY           = affineTransform.AxisY;
            Vector3          vector          = point - triangle.V0;
            Vector3          vector2         = triangle.V1 - triangle.V0;
            Vector3          vector3         = triangle.V2 - triangle.V0;
            Vector2          rkP             = new Vector2(axisX.Dot(vector), axisY.Dot(vector));

            Vector2[] vertices = new Vector2[]
            {
                Vector2.Zero,
                new Vector2(axisX.Dot(vector2), axisY.Dot(vector2)),
                new Vector2(axisX.Dot(vector3), axisY.Dot(vector3))
            };
            if (new IntersectionTriangle3Triangle3.Query2(3, vertices).ToTriangle(rkP, 0, 1, 2) <= 0)
            {
                this.Quantity  = 1;
                this.Points[0] = point;
                return(true);
            }
            return(false);
        }
示例#12
0
        // Token: 0x06000393 RID: 915 RVA: 0x0000FACC File Offset: 0x0000DCCC
        public static bool Intersects(this Plane3 plane, Box3 box)
        {
            IntersectionPlane3Box3 intersectionPlane3Box = new IntersectionPlane3Box3(plane, box);

            return(intersectionPlane3Box.Test());
        }
示例#13
0
 // Token: 0x0600032F RID: 815 RVA: 0x0000D148 File Offset: 0x0000B348
 public static bool Intersects(this Box3 box3, Plane3 plane3)
 {
     return(plane3.Intersects(box3));
 }
示例#14
0
        // Token: 0x060003C3 RID: 963 RVA: 0x00010D60 File Offset: 0x0000EF60
        public static bool Intersects(this Ray3 ray, Plane3 plane)
        {
            IntersectionRay3Plane3 intersectionRay3Plane = new IntersectionRay3Plane3(ray, plane);

            return(intersectionRay3Plane.Test());
        }
示例#15
0
        // Token: 0x06000182 RID: 386 RVA: 0x000074B8 File Offset: 0x000056B8
        public static double SignedDistanceTo(this Rectangle3 rectangle, Plane3 plane)
        {
            DistancePlane3Rectangle3 distancePlane3Rectangle = new DistancePlane3Rectangle3(plane, rectangle);

            return(distancePlane3Rectangle.SignedDistance);
        }
示例#16
0
 // Token: 0x0600039F RID: 927 RVA: 0x0000FD49 File Offset: 0x0000DF49
 public static Vector3?IntersectionWith(this Plane3 plane, Ray3 ray)
 {
     return(ray.IntersectionWith(plane));
 }
示例#17
0
 // Token: 0x0600027D RID: 637 RVA: 0x0000A7AC File Offset: 0x000089AC
 public IntersectionPlane3Circle3(Plane3 plane, Circle3 circle)
 {
     this        = default(IntersectionPlane3Circle3);
     this.plane  = plane;
     this.circle = circle;
 }
示例#18
0
 // Token: 0x060003A0 RID: 928 RVA: 0x0000FD52 File Offset: 0x0000DF52
 public static bool Intersects(this Plane3 plane, Segment3 segment)
 {
     return(segment.Intersects(plane));
 }
示例#19
0
        // Token: 0x06000390 RID: 912 RVA: 0x0000FA68 File Offset: 0x0000DC68
        public static ICollection <Vector3> IntersectionPointsWith(this Plane3 plane, Circle3 circle)
        {
            IntersectionPlane3Circle3 intersectionPlane3Circle = new IntersectionPlane3Circle3(plane, circle);

            return(new List <Vector3>(intersectionPlane3Circle.Find()));
        }
示例#20
0
        // Token: 0x06000399 RID: 921 RVA: 0x0000FC0C File Offset: 0x0000DE0C
        public static bool Intersects(this Plane3 plane, Triangle3 triangle)
        {
            IntersectionPlane3Triangle3 intersectionPlane3Triangle = new IntersectionPlane3Triangle3(plane, triangle, 0.0);

            return(intersectionPlane3Triangle.Test());
        }
示例#21
0
        // Token: 0x0600038F RID: 911 RVA: 0x0000FA48 File Offset: 0x0000DC48
        public static bool Intersects(this Plane3 plane, Circle3 circle)
        {
            IntersectionPlane3Circle3 intersectionPlane3Circle = new IntersectionPlane3Circle3(plane, circle);

            return(intersectionPlane3Circle.Test());
        }
示例#22
0
        // Token: 0x0600020B RID: 523 RVA: 0x000092FC File Offset: 0x000074FC
        public static double SignedDistanceTo(this Vector3 vector3, Plane3 plane3)
        {
            DistanceVector3Plane3 distanceVector3Plane = new DistanceVector3Plane3(vector3, plane3);

            return(distanceVector3Plane.SignedDistance);
        }
示例#23
0
        // Token: 0x060000A5 RID: 165 RVA: 0x00003C8C File Offset: 0x00001E8C
        public static double SignedDistanceTo(this Line3 line3, Plane3 plane3)
        {
            DistancePlane3Line3 distancePlane3Line = new DistancePlane3Line3(plane3, line3);

            return(distancePlane3Line.SignedDistance);
        }
示例#24
0
        // Token: 0x06000392 RID: 914 RVA: 0x0000FAAC File Offset: 0x0000DCAC
        public static ICollection <Vector3> IntersectionPointsWith(this Plane3 plane, Arc3 arc)
        {
            IntersectionPlane3Arc3 intersectionPlane3Arc = new IntersectionPlane3Arc3(plane, arc);

            return(intersectionPlane3Arc.Find());
        }
示例#25
0
        // Token: 0x06000391 RID: 913 RVA: 0x0000FA8C File Offset: 0x0000DC8C
        public static bool Intersects(this Plane3 plane, Arc3 arc)
        {
            IntersectionPlane3Arc3 intersectionPlane3Arc = new IntersectionPlane3Arc3(plane, arc);

            return(intersectionPlane3Arc.Test());
        }
示例#26
0
 // Token: 0x060003A1 RID: 929 RVA: 0x0000FD5B File Offset: 0x0000DF5B
 public static Vector3?IntersectionWith(this Plane3 plane, Segment3 segment)
 {
     return(segment.IntersectionWith(plane));
 }
示例#27
0
        // Token: 0x0600002C RID: 44 RVA: 0x00002958 File Offset: 0x00000B58
        public static double SignedDistanceTo(this Arc3 arc3, Plane3 plane3)
        {
            DistancePlane3Arc3 distancePlane3Arc = new DistancePlane3Arc3(plane3, arc3);

            return(distancePlane3Arc.SignedDistance);
        }
示例#28
0
        // Token: 0x06000394 RID: 916 RVA: 0x0000FAEC File Offset: 0x0000DCEC
        public static PlaneSideClassification SideClassification(this Plane3 plane, Box3 box)
        {
            IntersectionPlane3Box3 intersectionPlane3Box = new IntersectionPlane3Box3(plane, box);

            return(intersectionPlane3Box.SideClassification());
        }
示例#29
0
        // Token: 0x0600020C RID: 524 RVA: 0x0000931C File Offset: 0x0000751C
        public static Segment3 ShortestSegmentTo(this Vector3 vector3, Plane3 plane3)
        {
            DistanceVector3Plane3 distanceVector3Plane = new DistanceVector3Plane3(vector3, plane3);

            return(new Segment3(distanceVector3Plane.ClosestPointOnVector, distanceVector3Plane.ClosestPointOnPlane));
        }
示例#30
0
        // Token: 0x06000397 RID: 919 RVA: 0x0000FBAC File Offset: 0x0000DDAC
        public static bool Intersects(this Plane3 plane, Plane3 other)
        {
            IntersectionPlane3Plane3 intersectionPlane3Plane = new IntersectionPlane3Plane3(plane, other);

            return(intersectionPlane3Plane.Test());
        }