TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ DistFromSeg()

static double Terraria.Collision.DistFromSeg ( Vector2 p,
Vector2 q0,
Vector2 q1,
double radius,
ref float u )
inlinestaticprivate

Definition at line 151 of file Collision.cs.

152 {
153 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
154 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
155 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
156 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
157 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
158 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
159 //IL_002c: Unknown result type (might be due to invalid IL or missing references)
160 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
161 double num6 = q1.X - q0.X;
162 double num2 = q1.Y - q0.Y;
163 double num3 = q0.X - p.X;
164 double num4 = q0.Y - p.Y;
165 double num5 = Math.Sqrt(num6 * num6 + num2 * num2);
166 if (num5 < (double)Epsilon)
167 {
168 throw new Exception("Expected line segment, not point.");
169 }
170 return Math.Abs(num6 * num4 - num3 * num2) / num5;
171 }
static float Epsilon
Definition Collision.cs:36

References Terraria.Collision.Epsilon.

Referenced by Terraria.Collision.PointOnLine().

+ Here is the caller graph for this function: