Exemple #1
0
 public float m00017e(double p0, double p1)
 {
     struct0c6 structc;
     float num = (float) this.m000085();
     Vector2 vector = new Vector2(((float) (this.f0000c0.f000069 - this.f0000bf.f000069)) / num, ((float) (this.f0000c0.f000074 - this.f0000bf.f000074)) / num);
     Vector2 vector2 = new Vector2((float) (p0 - this.f0000bf.f000069), (float) (p1 - this.f0000bf.f000074));
     float num2 = Vector2.Dot(vector2, vector);
     if (num2 < 0f)
     {
         structc = new struct0c6(p0, p1, this.f0000bf.f000069, this.f0000bf.f000074);
         return (float) structc.m000085();
     }
     if (num2 > num)
     {
         structc = new struct0c6(p0, p1, this.f0000c0.f000069, this.f0000c0.f000074);
         return (float) structc.m000085();
     }
     vector.X *= num2;
     vector.Y *= num2;
     float num3 = vector2.X - vector.X;
     num3 *= num3;
     float num4 = vector2.Y - vector.Y;
     num4 *= num4;
     return (float) Math.Sqrt((double) (num3 + num4));
 }
Exemple #2
0
 public float m00017f(struct055 point, out struct0c6 connectingSegment)
 {
     double num = this.m000085();
     struct055 struct2 = new struct055((this.f0000c0.f000069 - this.f0000bf.f000069) / num, (this.f0000c0.f000074 - this.f0000bf.f000074) / num);
     struct055 struct3 = new struct055(point.f000069 - this.f0000bf.f000069, point.f000074 - this.f0000bf.f000074);
     double num2 = struct055.m000083(struct3, struct2);
     if (num2 < 0.0)
     {
         connectingSegment.f0000bf = point;
         connectingSegment.f0000c0 = this.f0000bf;
         return (float) connectingSegment.m000085();
     }
     if (num2 > num)
     {
         connectingSegment.f0000bf = point;
         connectingSegment.f0000c0 = this.f0000c0;
         return (float) connectingSegment.m000085();
     }
     connectingSegment.f0000bf = point;
     connectingSegment.f0000c0 = new struct055(this.f0000bf.f000069 + (num2 * struct2.f000069), this.f0000bf.f000074 + (num2 * struct2.f000074));
     return (float) connectingSegment.m000085();
 }
Exemple #3
0
 public void m000183(ref struct0c6 p0, out struct055 intersectionPoint)
 {
     double num = this.f0000c0.f000074 - this.f0000bf.f000074;
     double num2 = this.f0000bf.f000069 - this.f0000c0.f000069;
     double num3 = (num * this.f0000bf.f000069) + (num2 * this.f0000bf.f000074);
     double num4 = p0.f0000c0.f000074 - p0.f0000bf.f000074;
     double num5 = p0.f0000bf.f000069 - p0.f0000c0.f000069;
     double num6 = (num4 * p0.f0000bf.f000069) + (num5 * p0.f0000bf.f000074);
     double num7 = (num * num5) - (num4 * num2);
     if (num7 == 0.0)
     {
         intersectionPoint.f000069 = double.NaN;
         intersectionPoint.f000074 = double.NaN;
     }
     else
     {
         intersectionPoint.f000069 = ((num5 * num3) - (num2 * num6)) / num7;
         intersectionPoint.f000074 = ((num * num6) - (num4 * num3)) / num7;
         if (this.m000181(ref intersectionPoint) || p0.m000181(ref intersectionPoint))
         {
             double num8 = this.m00017d(intersectionPoint);
             double num9 = p0.m00017d(intersectionPoint);
             if ((num9 > 1E-09) || (num8 > 1E-09))
             {
                 intersectionPoint.f000069 = double.NaN;
                 intersectionPoint.f000074 = double.NaN;
             }
         }
     }
 }
Exemple #4
0
 public bool m000182(struct0c6 p0, out struct055 intersectionPoint)
 {
     this.m000183(ref p0, out intersectionPoint);
     return !double.IsNaN(intersectionPoint.f000069);
 }
Exemple #5
0
 public bool m000181(struct0c6 p0)
 {
     this.m000183(ref p0, out f00002a);
     return !double.IsNaN(f00002a.f000069);
 }
Exemple #6
0
 public float m000180(ref Vector3 vector, out struct0c6 connectingSegment)
 {
     float num = (float) this.m000085();
     Vector2 vector2 = new Vector2(((float) (this.f0000c0.f000069 - this.f0000bf.f000069)) / num, ((float) (this.f0000c0.f000074 - this.f0000bf.f000074)) / num);
     Vector2 vector3 = new Vector2(vector.X - ((float) this.f0000bf.f000069), vector.Y - ((float) this.f0000bf.f000074));
     float num2 = Vector2.Dot(vector3, vector2);
     if (num2 < 0f)
     {
         connectingSegment.f0000bf = new struct055(ref vector);
         connectingSegment.f0000c0 = this.f0000bf;
         return (float) connectingSegment.m00008d();
     }
     if (num2 > num)
     {
         connectingSegment.f0000bf = new struct055(ref vector);
         connectingSegment.f0000c0 = this.f0000c0;
         return (float) connectingSegment.m00008d();
     }
     connectingSegment.f0000bf = new struct055(ref vector);
     connectingSegment.f0000c0 = new struct055(this.f0000bf.f000069 + (num2 * vector2.X), this.f0000bf.f000074 + (num2 * vector2.Y));
     return (float) connectingSegment.m00008d();
 }