Esempio n. 1
0
        // Token: 0x06000362 RID: 866 RVA: 0x0000E8C0 File Offset: 0x0000CAC0
        public static Segment3?IntersectionWith(this Line3 line, Cylinder3 cylinder)
        {
            IntersectionLine3Cylinder3 intersectionLine3Cylinder = new IntersectionLine3Cylinder3(line, cylinder);

            intersectionLine3Cylinder.Find();
            if (intersectionLine3Cylinder.IntersectionType == Intersection.Type.IT_SEGMENT)
            {
                return(new Segment3?(new Segment3(intersectionLine3Cylinder.Point0, intersectionLine3Cylinder.Point1)));
            }
            if (intersectionLine3Cylinder.IntersectionType == Intersection.Type.IT_POINT)
            {
                return(new Segment3?(new Segment3(intersectionLine3Cylinder.Point0, intersectionLine3Cylinder.Point0)));
            }
            return(null);
        }
Esempio n. 2
0
        // Token: 0x0600041F RID: 1055 RVA: 0x00012980 File Offset: 0x00010B80
        public bool Find()
        {
            double[] array = new double[2];
            int      num   = IntersectionLine3Cylinder3.Find(this.segment.Origin, this.segment.Direction, this.cylinder, array);
            double   num2  = this.segment.Extent + 1E-08;

            if (num == 2)
            {
                if (Math.Abs(array[0]) < num2 && Math.Abs(array[1]) < num2)
                {
                    this.Point0           = this.segment.Origin + array[0] * this.segment.Direction;
                    this.Point1           = this.segment.Origin + array[1] * this.segment.Direction;
                    this.IntersectionType = Intersection.Type.IT_SEGMENT;
                }
                else if (Math.Abs(array[0]) < num2)
                {
                    this.Point0           = this.segment.Origin + array[0] * this.segment.Direction;
                    this.IntersectionType = Intersection.Type.IT_POINT;
                }
                else if (Math.Abs(array[1]) < num2)
                {
                    this.Point0           = this.segment.Origin + array[1] * this.segment.Direction;
                    this.IntersectionType = Intersection.Type.IT_POINT;
                }
                else
                {
                    this.IntersectionType = Intersection.Type.IT_EMPTY;
                }
            }
            else if (num == 1)
            {
                if (Math.Abs(array[0]) < num2)
                {
                    this.Point0           = this.segment.Origin + array[0] * this.segment.Direction;
                    this.IntersectionType = Intersection.Type.IT_POINT;
                }
                else
                {
                    this.IntersectionType = Intersection.Type.IT_EMPTY;
                }
            }
            else
            {
                this.IntersectionType = Intersection.Type.IT_EMPTY;
            }
            return(this.IntersectionType > Intersection.Type.IT_EMPTY);
        }
Esempio n. 3
0
        // Token: 0x060003D4 RID: 980 RVA: 0x00011478 File Offset: 0x0000F678
        public bool Find()
        {
            double[] array = new double[2];
            int      num   = IntersectionLine3Cylinder3.Find(this.ray.Origin, this.ray.Direction, this.cylinder, array);

            if (num == 2)
            {
                if (array[0] >= 0.0 && array[1] >= 0.0)
                {
                    this.Point0           = this.ray.Origin + array[0] * this.ray.Direction;
                    this.Point1           = this.ray.Origin + array[1] * this.ray.Direction;
                    this.IntersectionType = Intersection.Type.IT_SEGMENT;
                }
                else if (array[1] >= 0.0)
                {
                    this.Point0           = this.ray.Origin + array[1] * this.ray.Direction;
                    this.IntersectionType = Intersection.Type.IT_POINT;
                }
                else
                {
                    this.IntersectionType = Intersection.Type.IT_EMPTY;
                }
            }
            else if (num == 1)
            {
                if (array[0] >= 0.0)
                {
                    this.Point0           = this.ray.Origin + array[0] * this.ray.Direction;
                    this.IntersectionType = Intersection.Type.IT_POINT;
                }
                else
                {
                    this.IntersectionType = Intersection.Type.IT_EMPTY;
                }
            }
            else
            {
                this.IntersectionType = Intersection.Type.IT_EMPTY;
            }
            return(this.IntersectionType > Intersection.Type.IT_EMPTY);
        }
Esempio n. 4
0
        // Token: 0x06000361 RID: 865 RVA: 0x0000E8A0 File Offset: 0x0000CAA0
        public static bool Intersects(this Line3 line, Cylinder3 cylinder)
        {
            IntersectionLine3Cylinder3 intersectionLine3Cylinder = new IntersectionLine3Cylinder3(line, cylinder);

            return(intersectionLine3Cylinder.Find());
        }