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

◆ Contains() [5/7]

void Microsoft.Xna.Framework.BoundingFrustum.Contains ( ref BoundingSphere sphere,
out ContainmentType result )
inline

Definition at line 551 of file BoundingFrustum.cs.

552 {
553 Vector3 center = sphere.Center;
554 float radius = sphere.Radius;
555 int num = 0;
556 Plane[] array = planes;
557 for (int i = 0; i < array.Length; i++)
558 {
559 Plane plane = array[i];
560 float num2 = plane.Normal.X * center.X + plane.Normal.Y * center.Y + plane.Normal.Z * center.Z;
561 float num3 = num2 + plane.D;
562 if (num3 > radius)
563 {
564 result = ContainmentType.Disjoint;
565 return;
566 }
567 if (num3 < 0f - radius)
568 {
569 num++;
570 }
571 }
572 result = ((num == 6) ? ContainmentType.Contains : ContainmentType.Intersects);
573 }

References System.array, Microsoft.Xna.Framework.Plane.D, Microsoft.Xna.Framework.BoundingFrustum.planes, and Microsoft.Xna.Framework.Vector3.Z.