6using Microsoft.Xna.Framework.Design;
16 [
SuppressMessage(
"Microsoft.Design",
"CA1051:DoNotDeclareVisibleInstanceFields")]
19 [
SuppressMessage(
"Microsoft.Design",
"CA1051:DoNotDeclareVisibleInstanceFields")]
106 return string.Format(
currentCulture,
"{{Min:{0} Max:{1}}}",
new object[2]
132 result.Min.X = sphere.Center.X -
sphere.Radius;
133 result.Min.Y = sphere.Center.Y -
sphere.Radius;
134 result.Min.Z = sphere.Center.Z -
sphere.Radius;
135 result.Max.X = sphere.Center.X +
sphere.Radius;
136 result.Max.Y = sphere.Center.Y +
sphere.Radius;
137 result.Max.Z = sphere.Center.Z +
sphere.Radius;
143 result.Min.X = sphere.Center.X -
sphere.Radius;
144 result.Min.Y = sphere.Center.Y -
sphere.Radius;
145 result.Min.Z = sphere.Center.Z -
sphere.Radius;
146 result.Max.X = sphere.Center.X +
sphere.Radius;
147 result.Max.Y = sphere.Center.Y +
sphere.Radius;
148 result.Max.Z = sphere.Center.Z +
sphere.Radius;
206 return frustum.Intersects(
this);
212 vector.X = ((plane.Normal.X >= 0f) ?
Min.
X :
Max.
X);
213 vector.Y = ((plane.Normal.Y >= 0f) ?
Min.
Y :
Max.
Y);
214 vector.Z = ((plane.Normal.Z >= 0f) ?
Min.
Z :
Max.
Z);
216 vector2.X = ((plane.Normal.X >= 0f) ?
Max.
X :
Min.
X);
217 vector2.Y = ((plane.Normal.Y >= 0f) ?
Max.
Y :
Min.
Y);
218 vector2.Z = ((plane.Normal.Z >= 0f) ?
Max.
Z :
Min.
Z);
219 float num = plane.Normal.X * vector.X + plane.Normal.Y * vector.Y + plane.Normal.Z *
vector.Z;
220 if (num +
plane.D > 0f)
224 num = plane.Normal.X * vector2.X + plane.Normal.Y * vector2.Y + plane.Normal.Z *
vector2.Z;
225 if (num +
plane.D < 0f)
235 vector.X = ((plane.Normal.X >= 0f) ?
Min.
X :
Max.
X);
236 vector.Y = ((plane.Normal.Y >= 0f) ?
Min.
Y :
Max.
Y);
237 vector.Z = ((plane.Normal.Z >= 0f) ?
Min.
Z :
Max.
Z);
239 vector2.X = ((plane.Normal.X >= 0f) ?
Max.
X :
Min.
X);
240 vector2.Y = ((plane.Normal.Y >= 0f) ?
Max.
Y :
Min.
Y);
241 vector2.Z = ((plane.Normal.Z >= 0f) ?
Max.
Z :
Min.
Z);
242 float num = plane.Normal.X * vector.X + plane.Normal.Y * vector.Y + plane.Normal.Z *
vector.Z;
243 if (num +
plane.D > 0f)
248 num = plane.Normal.X * vector2.X + plane.Normal.Y * vector2.Y + plane.Normal.Z *
vector2.Z;
249 if (num +
plane.D < 0f)
262 float num2 =
float.MaxValue;
272 float num3 = 1f /
ray.Direction.X;
297 float num7 = 1f /
ray.Direction.Y;
345 float num2 =
float.MaxValue;
355 float num3 = 1f /
ray.Direction.X;
380 float num7 = 1f /
ray.Direction.Y;
468 result = ((Min.X <= box.Min.X && box.Max.X <= Max.X && Min.Y <= box.Min.Y && box.Max.Y <= Max.Y && Min.Z <= box.Min.Z && box.Max.Z <=
Max.
Z) ?
ContainmentType.Contains :
ContainmentType.Intersects);
483 foreach (
Vector3 point
in cornerArray)
504 result = ((Min.X <= point.X && point.X <= Max.X && Min.Y <= point.Y && point.Y <= Max.Y && Min.Z <= point.Z && point.Z <=
Max.
Z) ?
ContainmentType.Contains :
ContainmentType.Disjoint);
540 result.X = ((v.X >= 0f) ?
Max.
X :
Min.
X);
541 result.Y = ((v.Y >= 0f) ?
Max.
Y :
Min.
Y);
542 result.Z = ((v.Z >= 0f) ?
Max.
Z :
Min.
Z);
552 if (!(
a.Min !=
b.Min))
554 return a.Max !=
b.Max;
static string NullNotAllowed
static string BoundingBoxZeroPoints
static string NotEnoughCorners
static float Max(float value1, float value2)
static float Min(float value1, float value2)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
static CultureInfo CurrentCulture
static double Abs(double value)
bool Equals(BoundingBox other)
static void CreateFromSphere(ref BoundingSphere sphere, out BoundingBox result)
ContainmentType Contains(Vector3 point)
float? Intersects(Ray ray)
void SupportMapping(ref Vector3 v, out Vector3 result)
bool Intersects(BoundingSphere sphere)
void Contains(ref BoundingBox box, out ContainmentType result)
void Intersects(ref BoundingBox box, out bool result)
void GetCorners(Vector3[] corners)
void Contains(ref Vector3 point, out ContainmentType result)
override bool Equals(object obj)
void Contains(ref BoundingSphere sphere, out ContainmentType result)
void Intersects(ref BoundingSphere sphere, out bool result)
bool Intersects(BoundingBox box)
ContainmentType Contains(BoundingBox box)
bool Intersects(BoundingFrustum frustum)
override string ToString()
static BoundingBox CreateFromPoints(IEnumerable< Vector3 > points)
static bool operator==(BoundingBox a, BoundingBox b)
BoundingBox(Vector3 min, Vector3 max)
ContainmentType Contains(BoundingSphere sphere)
static BoundingBox CreateFromSphere(BoundingSphere sphere)
static bool operator!=(BoundingBox a, BoundingBox b)
PlaneIntersectionType Intersects(Plane plane)
void Intersects(ref Plane plane, out PlaneIntersectionType result)
override int GetHashCode()
void Intersects(ref Ray ray, out float? result)
static void CreateMerged(ref BoundingBox original, ref BoundingBox additional, out BoundingBox result)
ContainmentType Contains(BoundingFrustum frustum)
static BoundingBox CreateMerged(BoundingBox original, BoundingBox additional)
static Vector3 Clamp(Vector3 value1, Vector3 min, Vector3 max)
static Vector3 Min(Vector3 value1, Vector3 value2)
override string ToString()
static Vector3 Max(Vector3 value1, Vector3 value2)
override int GetHashCode()
static float DistanceSquared(Vector3 value1, Vector3 value2)