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

◆ Contains() [3/7]

ContainmentType Microsoft.Xna.Framework.BoundingFrustum.Contains ( BoundingSphere sphere)
inline

Definition at line 524 of file BoundingFrustum.cs.

525 {
526 Vector3 center = sphere.Center;
527 float radius = sphere.Radius;
528 int num = 0;
529 Plane[] array = planes;
530 for (int i = 0; i < array.Length; i++)
531 {
532 Plane plane = array[i];
533 float num2 = plane.Normal.X * center.X + plane.Normal.Y * center.Y + plane.Normal.Z * center.Z;
534 float num3 = num2 + plane.D;
535 if (num3 > radius)
536 {
537 return ContainmentType.Disjoint;
538 }
539 if (num3 < 0f - radius)
540 {
541 num++;
542 }
543 }
544 if (num != 6)
545 {
546 return ContainmentType.Intersects;
547 }
548 return ContainmentType.Contains;
549 }

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