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

◆ Intersects() [4/5]

void Microsoft.Xna.Framework.Plane.Intersects ( ref BoundingBox box,
out PlaneIntersectionType result )
inline

Definition at line 288 of file Plane.cs.

289 {
290 Vector3 vector = default(Vector3);
291 vector.X = ((Normal.X >= 0f) ? box.Min.X : box.Max.X);
292 vector.Y = ((Normal.Y >= 0f) ? box.Min.Y : box.Max.Y);
293 vector.Z = ((Normal.Z >= 0f) ? box.Min.Z : box.Max.Z);
294 Vector3 vector2 = default(Vector3);
295 vector2.X = ((Normal.X >= 0f) ? box.Max.X : box.Min.X);
296 vector2.Y = ((Normal.Y >= 0f) ? box.Max.Y : box.Min.Y);
297 vector2.Z = ((Normal.Z >= 0f) ? box.Max.Z : box.Min.Z);
298 float num = Normal.X * vector.X + Normal.Y * vector.Y + Normal.Z * vector.Z;
299 if (num + D > 0f)
300 {
301 result = PlaneIntersectionType.Front;
302 return;
303 }
304 num = Normal.X * vector2.X + Normal.Y * vector2.Y + Normal.Z * vector2.Z;
305 if (num + D < 0f)
306 {
307 result = PlaneIntersectionType.Back;
308 }
309 else
310 {
311 result = PlaneIntersectionType.Intersecting;
312 }
313 }

References Microsoft.Xna.Framework.Plane.D, and Microsoft.Xna.Framework.Vector3.Z.