Beispiel #1
0
        // Token: 0x060002B7 RID: 695 RVA: 0x0000B15C File Offset: 0x0000935C
        public static double[] GetRoots(Line3 line, Torus3 torus, out int quantity)
        {
            double num  = torus.OuterRadius * torus.OuterRadius;
            double num2 = torus.InnerRadius * torus.InnerRadius;
            double num3 = line.Direction.Dot(line.Direction);
            double num4 = line.Origin.Dot(line.Direction);
            double num5 = line.Origin.Dot(line.Origin) - (num + num2);

            double[] array = new double[5];
            double   z     = line.Origin.Z;
            double   z2    = line.Direction.Z;

            double[] array2 = array;
            int      num6   = 0;
            double   num7   = num5;
            double   num8   = num7 * num7;
            double   num9   = 4.0 * num;
            double   num10  = num2;
            double   num11  = z;

            array2[num6] = num8 - num9 * (num10 - num11 * num11);
            array[1]     = 4.0 * num4 * num5 + 8.0 * num * z2 * z;
            array[2]     = 2.0 * num3 * num5 + 4.0 * num4 * num4 + 4.0 * num * z2 * z2;
            array[3]     = 4.0 * num3 * num4;
            double[] array3 = array;
            int      num12  = 4;
            double   num13  = num3;

            array3[num12] = num13 * num13;
            PolynomialRoots polynomialRoots = new PolynomialRoots(1E-08);

            polynomialRoots.FindB(new Polynomial1(array), 6);
            quantity = polynomialRoots.Count;
            return(polynomialRoots.Roots);
        }
Beispiel #2
0
        // Token: 0x060003BF RID: 959 RVA: 0x00010C24 File Offset: 0x0000EE24
        public static ICollection <Vector3> IntersectionPointsWith(this Ray3 ray, Torus3 torus)
        {
            List <Vector3>         list = new List <Vector3>();
            IntersectionRay3Torus3 intersectionRay3Torus = new IntersectionRay3Torus3(ray, torus);

            if (intersectionRay3Torus.Find())
            {
                Vector3[] array = new Vector3[]
                {
                    intersectionRay3Torus.Point0,
                    intersectionRay3Torus.Point1,
                    intersectionRay3Torus.Point2,
                    intersectionRay3Torus.Point3
                };
                for (int i = 0; i < intersectionRay3Torus.Quantity; i++)
                {
                    list.Add(array[i]);
                }
            }
            return(list);
        }
Beispiel #3
0
        // Token: 0x060003BE RID: 958 RVA: 0x00010C04 File Offset: 0x0000EE04
        public static bool Intersects(this Ray3 ray, Torus3 torus)
        {
            IntersectionRay3Torus3 intersectionRay3Torus = new IntersectionRay3Torus3(ray, torus);

            return(intersectionRay3Torus.Find());
        }
Beispiel #4
0
 // Token: 0x060002AA RID: 682 RVA: 0x0000B0DD File Offset: 0x000092DD
 public IntersectionLine3Torus3(Line3 line, Torus3 torus)
 {
     this       = default(IntersectionLine3Torus3);
     this.line  = line;
     this.torus = torus;
 }
Beispiel #5
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());
        }
 // Token: 0x0600025D RID: 605 RVA: 0x0000A3E7 File Offset: 0x000085E7
 public static bool Intersects(this Torus3 torus, Line3 line)
 {
     return(line.Intersects(torus));
 }
 // Token: 0x06000260 RID: 608 RVA: 0x0000A402 File Offset: 0x00008602
 public static ICollection <Vector3> IntersectionPointsWith(this Torus3 torus, Ray3 ray)
 {
     return(ray.IntersectionPointsWith(torus));
 }
 // Token: 0x0600025F RID: 607 RVA: 0x0000A3F9 File Offset: 0x000085F9
 public static bool Intersects(this Torus3 torus, Ray3 ray)
 {
     return(ray.Intersects(torus));
 }
 // Token: 0x0600025E RID: 606 RVA: 0x0000A3F0 File Offset: 0x000085F0
 public static ICollection <Vector3> IntersectionPointsWith(this Torus3 torus, Line3 line)
 {
     return(line.IntersectionPointsWith(torus));
 }
 // Token: 0x0600029C RID: 668 RVA: 0x0000AF62 File Offset: 0x00009162
 public IntersectionRay3Torus3(Ray3 ray, Torus3 torus)
 {
     this       = default(IntersectionRay3Torus3);
     this.ray   = ray;
     this.torus = torus;
 }