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

◆ Intersects() [4/7]

float? Microsoft.Xna.Framework.Ray.Intersects ( Plane plane)
inline

Definition at line 78 of file Ray.cs.

79 {
80 float num = plane.Normal.X * Direction.X + plane.Normal.Y * Direction.Y + plane.Normal.Z * Direction.Z;
81 if (Math.Abs(num) < 1E-05f)
82 {
83 return null;
84 }
85 float num2 = plane.Normal.X * Position.X + plane.Normal.Y * Position.Y + plane.Normal.Z * Position.Z;
86 float num3 = (0f - plane.D - num2) / num;
87 if (num3 < 0f)
88 {
89 if (num3 < -1E-05f)
90 {
91 return null;
92 }
93 num3 = 0f;
94 }
95 return num3;
96 }
static double Abs(double value)

References System.Math.Abs(), Microsoft.Xna.Framework.Ray.Direction, System.E, and Microsoft.Xna.Framework.Vector3.Z.