6using Microsoft.Xna.Framework.Design;
14 [
SuppressMessage(
"Microsoft.Design",
"CA1051:DoNotDeclareVisibleInstanceFields")]
17 [
SuppressMessage(
"Microsoft.Design",
"CA1051:DoNotDeclareVisibleInstanceFields")]
57 return string.Format(
currentCulture,
"{{Center:{0} Radius:{1}}}",
new object[2]
67 float num = result.Length();
87 result2.Radius =
num4;
115 result.Radius =
num4;
123 result.Radius =
result2 * 0.5f;
131 result.Radius =
result2 * 0.5f;
209 vector.X = point2.X -
result4.X;
210 vector.Y = point2.Y -
result4.Y;
211 vector.Z = point2.Z -
result4.Z;
215 num = (num +
num2) * 0.5f;
221 result5.Radius = num;
264 return plane.Intersects(
this);
274 return ray.Intersects(
this);
304 if (!
box.Intersects(
this))
310 vector.X = Center.X -
box.Min.X;
311 vector.Y = Center.Y -
box.Max.Y;
312 vector.Z = Center.Z -
box.Max.Z;
313 if (
vector.LengthSquared() > num)
317 vector.X = Center.X -
box.Max.X;
318 vector.Y = Center.Y -
box.Max.Y;
319 vector.Z = Center.Z -
box.Max.Z;
320 if (
vector.LengthSquared() > num)
324 vector.X = Center.X -
box.Max.X;
325 vector.Y = Center.Y -
box.Min.Y;
326 vector.Z = Center.Z -
box.Max.Z;
327 if (
vector.LengthSquared() > num)
331 vector.X = Center.X -
box.Min.X;
332 vector.Y = Center.Y -
box.Min.Y;
333 vector.Z = Center.Z -
box.Max.Z;
334 if (
vector.LengthSquared() > num)
338 vector.X = Center.X -
box.Min.X;
339 vector.Y = Center.Y -
box.Max.Y;
340 vector.Z = Center.Z -
box.Min.Z;
341 if (
vector.LengthSquared() > num)
345 vector.X = Center.X -
box.Max.X;
346 vector.Y = Center.Y -
box.Max.Y;
347 vector.Z = Center.Z -
box.Min.Z;
348 if (
vector.LengthSquared() > num)
352 vector.X = Center.X -
box.Max.X;
353 vector.Y = Center.Y -
box.Min.Y;
354 vector.Z = Center.Z -
box.Min.Z;
355 if (
vector.LengthSquared() > num)
359 vector.X = Center.X -
box.Min.X;
360 vector.Y = Center.Y -
box.Min.Y;
361 vector.Z = Center.Z -
box.Min.Z;
362 if (
vector.LengthSquared() > num)
380 vector.X = Center.X -
box.Min.X;
381 vector.Y = Center.Y -
box.Max.Y;
382 vector.Z = Center.Z -
box.Max.Z;
383 if (
vector.LengthSquared() > num)
387 vector.X = Center.X -
box.Max.X;
388 vector.Y = Center.Y -
box.Max.Y;
389 vector.Z = Center.Z -
box.Max.Z;
390 if (
vector.LengthSquared() > num)
394 vector.X = Center.X -
box.Max.X;
395 vector.Y = Center.Y -
box.Min.Y;
396 vector.Z = Center.Z -
box.Max.Z;
397 if (
vector.LengthSquared() > num)
401 vector.X = Center.X -
box.Min.X;
402 vector.Y = Center.Y -
box.Min.Y;
403 vector.Z = Center.Z -
box.Max.Z;
404 if (
vector.LengthSquared() > num)
408 vector.X = Center.X -
box.Min.X;
409 vector.Y = Center.Y -
box.Max.Y;
410 vector.Z = Center.Z -
box.Min.Z;
411 if (
vector.LengthSquared() > num)
415 vector.X = Center.X -
box.Max.X;
416 vector.Y = Center.Y -
box.Max.Y;
417 vector.Z = Center.Z -
box.Min.Z;
418 if (
vector.LengthSquared() > num)
422 vector.X = Center.X -
box.Max.X;
423 vector.Y = Center.Y -
box.Min.Y;
424 vector.Z = Center.Z -
box.Min.Z;
425 if (!(
vector.LengthSquared() > num))
427 vector.X = Center.X -
box.Min.X;
428 vector.Y = Center.Y -
box.Min.Y;
429 vector.Z = Center.Z -
box.Min.Z;
430 if (!(
vector.LengthSquared() > num))
450 for (
int i = 0; i < cornerArray.
Length; i++)
453 vector2.X = vector.X -
Center.
X;
454 vector2.Y = vector.Y -
Center.
Y;
455 vector2.Z = vector.Z -
Center.
Z;
456 if (
vector2.LengthSquared() > num)
506 float num = v.Length();
508 result.X = Center.X + v.X *
num2;
509 result.Y = Center.Y + v.Y *
num2;
510 result.Z = Center.Z + v.Z *
num2;
517 float val = matrix.M11 * matrix.M11 + matrix.M12 * matrix.M12 + matrix.M13 * matrix.
M13;
518 float val2 = matrix.M21 * matrix.M21 + matrix.M22 * matrix.M22 + matrix.M23 * matrix.
M23;
519 float val3 = matrix.M31 * matrix.M31 + matrix.M32 * matrix.M32 + matrix.M33 * matrix.
M33;
528 float val = matrix.M11 * matrix.M11 + matrix.M12 * matrix.M12 + matrix.M13 * matrix.M13;
529 float val2 = matrix.M21 * matrix.M21 + matrix.M22 * matrix.M22 + matrix.M23 * matrix.M23;
530 float val3 = matrix.M31 * matrix.M31 + matrix.M32 * matrix.M32 + matrix.M33 * matrix.M33;
542 if (!(
a.Center !=
b.Center))
544 return a.Radius !=
b.Radius;
static string NullNotAllowed
static string NegativeRadius
static string BoundingSphereZeroPoints
static float Max(float value1, float value2)
static float Min(float value1, float value2)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
Enumerator GetEnumerator()
static CultureInfo CurrentCulture
static double Sqrt(double d)
static byte Max(byte val1, byte val2)
ContainmentType Contains(BoundingFrustum frustum)
float? Intersects(Ray ray)
bool Intersects(BoundingBox box)
BoundingSphere Transform(Matrix matrix)
bool Intersects(BoundingFrustum frustum)
void Intersects(ref Ray ray, out float? result)
void Intersects(ref Plane plane, out PlaneIntersectionType result)
bool Equals(BoundingSphere other)
static void CreateMerged(ref BoundingSphere original, ref BoundingSphere additional, out BoundingSphere result)
ContainmentType Contains(BoundingSphere sphere)
ContainmentType Contains(Vector3 point)
void Contains(ref Vector3 point, out ContainmentType result)
static BoundingSphere CreateFromBoundingBox(BoundingBox box)
PlaneIntersectionType Intersects(Plane plane)
void Intersects(ref BoundingSphere sphere, out bool result)
static BoundingSphere CreateFromPoints(IEnumerable< Vector3 > points)
static BoundingSphere CreateMerged(BoundingSphere original, BoundingSphere additional)
void SupportMapping(ref Vector3 v, out Vector3 result)
void Contains(ref BoundingSphere sphere, out ContainmentType result)
void Transform(ref Matrix matrix, out BoundingSphere result)
static BoundingSphere CreateFromFrustum(BoundingFrustum frustum)
BoundingSphere(Vector3 center, float radius)
void Contains(ref BoundingBox box, out ContainmentType result)
void Intersects(ref BoundingBox box, out bool result)
ContainmentType Contains(BoundingBox box)
bool Intersects(BoundingSphere sphere)
override bool Equals(object obj)
static bool operator==(BoundingSphere a, BoundingSphere b)
override int GetHashCode()
static bool operator!=(BoundingSphere a, BoundingSphere b)
override string ToString()
static void CreateFromBoundingBox(ref BoundingBox box, out BoundingSphere result)
static Vector3 Clamp(Vector3 value1, Vector3 min, Vector3 max)
static Vector3 Transform(Vector3 position, Matrix matrix)
static Vector3 Subtract(Vector3 value1, Vector3 value2)
override string ToString()
static Vector3 Lerp(Vector3 value1, Vector3 value2, float amount)
static float Distance(Vector3 value1, Vector3 value2)
override int GetHashCode()
static float DistanceSquared(Vector3 value1, Vector3 value2)