示例#1
0
        // Token: 0x060002B8 RID: 696 RVA: 0x0000B2BC File Offset: 0x000094BC
        public bool Find()
        {
            int quantity;

            double[] roots = IntersectionLine3Torus3.GetRoots(this.line, this.torus, out quantity);
            this.Quantity = quantity;
            Vector3[] array = new Vector3[4];
            for (int i = 0; i < this.Quantity; i++)
            {
                array[i] = this.line.Origin + roots[i] * this.line.Direction;
            }
            this.Point0           = array[0];
            this.Point1           = array[1];
            this.Point2           = array[2];
            this.Point3           = array[3];
            this.IntersectionType = ((this.Quantity > 0) ? Intersection.Type.IT_POINT : Intersection.Type.IT_EMPTY);
            return(this.IntersectionType > Intersection.Type.IT_EMPTY);
        }
示例#2
0
        // Token: 0x06000365 RID: 869 RVA: 0x0000E9C0 File Offset: 0x0000CBC0
        public static ICollection <Vector3> IntersectionPointsWith(this Line3 line, Torus3 torus)
        {
            List <Vector3>          list = new List <Vector3>();
            IntersectionLine3Torus3 intersectionLine3Torus = new IntersectionLine3Torus3(line, torus);

            if (intersectionLine3Torus.Find())
            {
                Vector3[] array = new Vector3[]
                {
                    intersectionLine3Torus.Point0,
                    intersectionLine3Torus.Point1,
                    intersectionLine3Torus.Point2,
                    intersectionLine3Torus.Point3
                };
                for (int i = 0; i < intersectionLine3Torus.Quantity; i++)
                {
                    list.Add(array[i]);
                }
            }
            return(list);
        }
        // Token: 0x060002A9 RID: 681 RVA: 0x0000AFE0 File Offset: 0x000091E0
        public bool Find()
        {
            int num;

            double[] roots = IntersectionLine3Torus3.GetRoots(new Line3(this.ray.Origin, this.ray.Direction), this.torus, out num);
            this.Quantity = 0;
            Vector3[] array = new Vector3[4];
            for (int i = 0; i < num; i++)
            {
                if (roots[i] >= 0.0)
                {
                    Vector3[] array2   = array;
                    int       quantity = this.Quantity;
                    this.Quantity    = quantity + 1;
                    array2[quantity] = this.ray.Origin + roots[i] * this.ray.Direction;
                }
            }
            this.Point0           = array[0];
            this.Point1           = array[1];
            this.Point2           = array[2];
            this.Point3           = array[3];
            this.IntersectionType = ((this.Quantity > 0) ? Intersection.Type.IT_POINT : Intersection.Type.IT_EMPTY);
            return(this.IntersectionType > Intersection.Type.IT_EMPTY);
        }
示例#4
0
        // Token: 0x06000364 RID: 868 RVA: 0x0000E9A0 File Offset: 0x0000CBA0
        public static bool Intersects(this Line3 line, Torus3 torus)
        {
            IntersectionLine3Torus3 intersectionLine3Torus = new IntersectionLine3Torus3(line, torus);

            return(intersectionLine3Torus.Find());
        }