90 if (boundingFrustum !=
null)
144 for (
int i = 0; i < 6; i++)
174 Ray result =
default(
Ray);
183 float num = (0f - plane.D -
Vector3.
Dot(plane.Normal, ray.Position)) /
Vector3.
Dot(plane.Normal, ray.Direction);
184 return ray.Position + ray.Direction * num;
201 if (result2.LengthSquared() < 1
E-05f)
205 float num =
float.MaxValue;
211 v.X = 0f - result2.
X;
212 v.Y = 0f - result2.Y;
213 v.Z = 0f - result2.Z;
215 box.SupportMapping(ref result2, out var result4);
217 float num3 = result2.X * result5.X + result2.Y * result5.Y + result2.Z * result5.Z;
225 num = result2.LengthSquared();
226 if (num4 - num <= 1
E-05f * num4)
248 if (result.LengthSquared() < 1
E-05f)
252 float num =
float.MaxValue;
263 float num3 = result.X * result4.X + result.Y * result4.Y + result.Z * result4.Z;
271 num = result.LengthSquared();
273 if (num4 - num <= 1
E-05f * num4)
285 for (
int i = 0; i < 8; i++)
288 num = ((!(result + plane.D > 0f)) ? (num | 2) : (num | 1));
304 for (
int i = 0; i < 8; i++)
307 num = ((!(result2 + plane.D > 0f)) ? (num | 2) : (num | 1));
325 Contains(ref ray.Position, out var result2);
331 float num =
float.MinValue;
332 float num2 =
float.MaxValue;
335 for (
int i = 0; i <
array.Length; i++)
339 Vector3.
Dot(ref ray.Direction, ref vector, out var result3);
340 Vector3.
Dot(ref ray.Position, ref vector, out var result4);
350 float num3 = (0f - result4) / result3;
374 float num4 = ((num >= 0f) ? num : num2);
395 if (result2.LengthSquared() < 1
E-05f)
399 float num =
float.MaxValue;
405 v.X = 0f - result2.
X;
406 v.Y = 0f - result2.Y;
407 v.Z = 0f - result2.Z;
409 sphere.SupportMapping(ref result2, out var result4);
411 float num3 = result2.X * result5.X + result2.Y * result5.Y + result2.Z * result5.Z;
419 num = result2.LengthSquared();
420 if (num4 - num <= 1
E-05f * num4)
436 switch (box.Intersects(plane))
458 switch (box.Intersects(plane))
496 for (
int i = 0; i <
array.Length; i++)
499 float num = plane.Normal.X * point.X + plane.Normal.Y * point.Y + plane.Normal.Z * point.Z + plane.
D;
511 for (
int i = 0; i <
array.Length; i++)
514 float num = plane.Normal.X * point.X + plane.Normal.Y * point.Y + plane.Normal.Z * point.Z + plane.
D;
527 float radius = sphere.
Radius;
530 for (
int i = 0; i <
array.Length; 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;
539 if (num3 < 0f - radius)
553 Vector3 center = sphere.Center;
554 float radius = sphere.Radius;
557 for (
int i = 0; i <
array.Length; 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;
567 if (num3 < 0f - radius)
582 if (result3 > result2)
593 return object.Equals(a, b);
598 return !
object.Equals(a, b);
ContainmentType Contains(BoundingFrustum frustum)
void GetCorners(Vector3[] corners)
void Intersects(ref Plane plane, out PlaneIntersectionType result)
static bool operator==(BoundingFrustum a, BoundingFrustum b)
void Contains(ref Vector3 point, out ContainmentType result)
override bool Equals(object obj)
void Contains(ref BoundingSphere sphere, out ContainmentType result)
void SetMatrix(ref Matrix value)
void Intersects(ref Ray ray, out float? result)
float? Intersects(Ray ray)
override string ToString()
bool Equals(BoundingFrustum other)
void Intersects(ref BoundingBox box, out bool result)
bool Intersects(BoundingFrustum frustum)
static Vector3 ComputeIntersection(ref Plane plane, ref Ray ray)
PlaneIntersectionType Intersects(Plane plane)
void Contains(ref BoundingBox box, out ContainmentType result)
override int GetHashCode()
void SupportMapping(ref Vector3 v, out Vector3 result)
const int BottomPlaneIndex
ContainmentType Contains(BoundingSphere sphere)
bool Intersects(BoundingSphere sphere)
void Intersects(ref BoundingSphere sphere, out bool result)
static bool operator!=(BoundingFrustum a, BoundingFrustum b)
ContainmentType Contains(Vector3 point)
const int RightPlaneIndex
BoundingFrustum(Matrix value)
static Ray ComputeIntersectionLine(ref Plane p1, ref Plane p2)
bool Intersects(BoundingBox box)
ContainmentType Contains(BoundingBox box)
static string NotEnoughCorners
bool AddSupportPoint(ref Vector3 newPoint)
static CultureInfo CurrentCulture
static double Abs(double value)
override int GetHashCode()
PlaneIntersectionType Intersects(BoundingBox box)
override string ToString()
static Vector3 Min(Vector3 value1, Vector3 value2)
static float Dot(Vector3 vector1, Vector3 vector2)
static Vector3 Subtract(Vector3 value1, Vector3 value2)
static Vector3 Max(Vector3 value1, Vector3 value2)
static Vector3 Cross(Vector3 vector1, Vector3 vector2)