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

◆ Intersects() [7/7]

void Microsoft.Xna.Framework.Ray.Intersects ( ref Plane plane,
out float? result )
inline

Definition at line 98 of file Ray.cs.

99 {
100 float num = plane.Normal.X * Direction.X + plane.Normal.Y * Direction.Y + plane.Normal.Z * Direction.Z;
101 if (Math.Abs(num) < 1E-05f)
102 {
103 result = null;
104 return;
105 }
106 float num2 = plane.Normal.X * Position.X + plane.Normal.Y * Position.Y + plane.Normal.Z * Position.Z;
107 float num3 = (0f - plane.D - num2) / num;
108 if (num3 < 0f)
109 {
110 if (num3 < -1E-05f)
111 {
112 result = null;
113 return;
114 }
115 result = 0f;
116 }
117 result = num3;
118 }
static double Abs(double value)

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