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

◆ Contains() [3/7]

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

Definition at line 507 of file BoundingBox.cs.

508 {
509 Vector3.Clamp(ref sphere.Center, ref Min, ref Max, out var result);
510 Vector3.DistanceSquared(ref sphere.Center, ref result, out var result2);
511 float radius = sphere.Radius;
512 if (result2 > radius * radius)
513 {
514 return ContainmentType.Disjoint;
515 }
516 if (!(Min.X + radius <= sphere.Center.X) || !(sphere.Center.X <= Max.X - radius) || !(Max.X - Min.X > radius) || !(Min.Y + radius <= sphere.Center.Y) || !(sphere.Center.Y <= Max.Y - radius) || !(Max.Y - Min.Y > radius) || !(Min.Z + radius <= sphere.Center.Z) || !(sphere.Center.Z <= Max.Z - radius) || !(Max.X - Min.X > radius))
517 {
518 return ContainmentType.Intersects;
519 }
521 }
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)

References Microsoft.Xna.Framework.Vector3.Clamp(), System.Collections.Generic.Dictionary< TKey, TValue >.Contains(), Microsoft.Xna.Framework.Vector3.DistanceSquared(), Microsoft.Xna.Framework.BoundingBox.Max, Microsoft.Xna.Framework.BoundingBox.Min, Microsoft.Xna.Framework.Vector3.X, Microsoft.Xna.Framework.Vector3.Y, and Microsoft.Xna.Framework.Vector3.Z.