// Token: 0x06000395 RID: 917 RVA: 0x0000FB0C File Offset: 0x0000DD0C public static bool Intersects(this Plane3 plane, AxisAlignedBox3 axisAlignedBox) { Box3 box = new Box3(axisAlignedBox.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox.ExtentX, axisAlignedBox.ExtentY, axisAlignedBox.ExtentZ); IntersectionPlane3Box3 intersectionPlane3Box = new IntersectionPlane3Box3(plane, box); return(intersectionPlane3Box.Test()); }
// Token: 0x0600040F RID: 1039 RVA: 0x00012420 File Offset: 0x00010620 public static bool Intersects(this Segment3 segment, AxisAlignedBox3 axisAlignedBox) { Box3 box = new Box3(axisAlignedBox.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox.ExtentX, axisAlignedBox.ExtentY, axisAlignedBox.ExtentZ); IntersectionSegment3Box3 intersectionSegment3Box = new IntersectionSegment3Box3(segment, box, true); return(intersectionSegment3Box.Test()); }
// Token: 0x0600008D RID: 141 RVA: 0x000038CC File Offset: 0x00001ACC public static Vector3 ClosestPointTo(this Line3 line3, AxisAlignedBox3 axisAlignedBox3) { Box3 box = new Box3(axisAlignedBox3.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox3.ExtentX, axisAlignedBox3.ExtentY, axisAlignedBox3.ExtentZ); DistanceLine3Box3 distanceLine3Box = new DistanceLine3Box3(line3, box); return(distanceLine3Box.ClosestPointOnLine); }
// Token: 0x06000396 RID: 918 RVA: 0x0000FB5C File Offset: 0x0000DD5C public static PlaneSideClassification SideClassification(this Plane3 plane, AxisAlignedBox3 axisAlignedBox) { Box3 box = new Box3(axisAlignedBox.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox.ExtentX, axisAlignedBox.ExtentY, axisAlignedBox.ExtentZ); IntersectionPlane3Box3 intersectionPlane3Box = new IntersectionPlane3Box3(plane, box); return(intersectionPlane3Box.SideClassification()); }
// Token: 0x06000011 RID: 17 RVA: 0x000023EC File Offset: 0x000005EC public static Vector3 ClosestPointTo(this AxisAlignedBox3 axisAlignedBox3, Ray3 ray3) { Box3 box = new Box3(axisAlignedBox3.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox3.ExtentX, axisAlignedBox3.ExtentY, axisAlignedBox3.ExtentZ); DistanceRay3Box3 distanceRay3Box = new DistanceRay3Box3(ray3, box); return(distanceRay3Box.ClosestPointOnBox); }
// Token: 0x06000204 RID: 516 RVA: 0x00009198 File Offset: 0x00007398 public static double DistanceTo(this Vector3 vector3, AxisAlignedBox3 axisAlignedBox3) { Box3 box = new Box3(axisAlignedBox3.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox3.ExtentX, axisAlignedBox3.ExtentY, axisAlignedBox3.ExtentZ); DistanceVector3Box3 distanceVector3Box = new DistanceVector3Box3(vector3, box); return(distanceVector3Box.Distance); }
// Token: 0x0600000F RID: 15 RVA: 0x00002348 File Offset: 0x00000548 public static Segment3 ShortestSegmentTo(this AxisAlignedBox3 axisAlignedBox3, Line3 line3) { Box3 box = new Box3(axisAlignedBox3.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox3.ExtentX, axisAlignedBox3.ExtentY, axisAlignedBox3.ExtentZ); DistanceLine3Box3 distanceLine3Box = new DistanceLine3Box3(line3, box); return(new Segment3(distanceLine3Box.ClosestPointOnBox, distanceLine3Box.ClosestPointOnLine)); }
// Token: 0x0600019E RID: 414 RVA: 0x00007988 File Offset: 0x00005B88 public static Vector3 ClosestPointTo(this Segment3 segment3, AxisAlignedBox3 axisAlignedBox3) { Box3 box = new Box3(axisAlignedBox3.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox3.ExtentX, axisAlignedBox3.ExtentY, axisAlignedBox3.ExtentZ); DistanceSegment3Box3 distanceSegment3Box = new DistanceSegment3Box3(segment3, box); return(distanceSegment3Box.ClosestPointOnSegment); }
// Token: 0x06000205 RID: 517 RVA: 0x000091E8 File Offset: 0x000073E8 public static Segment3 ShortestSegmentTo(this Vector3 vector3, AxisAlignedBox3 axisAlignedBox3) { Box3 box = new Box3(axisAlignedBox3.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox3.ExtentX, axisAlignedBox3.ExtentY, axisAlignedBox3.ExtentZ); DistanceVector3Box3 distanceVector3Box = new DistanceVector3Box3(vector3, box); return(new Segment3(distanceVector3Box.ClosestPointOnVector, distanceVector3Box.ClosestPointOnBox)); }
// Token: 0x0600030F RID: 783 RVA: 0x0000C7FC File Offset: 0x0000A9FC public static AxisAlignedBox3?IntersectionWith(this AxisAlignedBox3 axisAlignedBox3, AxisAlignedBox3 other) { IntersectionAxisAlignedBox3AxisAlignedBox3 intersectionAxisAlignedBox3AxisAlignedBox = new IntersectionAxisAlignedBox3AxisAlignedBox3(axisAlignedBox3, other); AxisAlignedBox3 value; if (intersectionAxisAlignedBox3AxisAlignedBox.Find(out value)) { return(new AxisAlignedBox3?(value)); } return(null); }
// Token: 0x06000487 RID: 1159 RVA: 0x000167AC File Offset: 0x000149AC public static AxisAlignedBox3 ComputeAxisAlignedBoundingBox(this Cylinder3 cylinder) { double scalar = cylinder.Height / 2.0; AffineTransform3 affineTransform = Transform3Factory.CreateOrthonormalBasis(cylinder.Axis.Direction); Circle3 circle = new Circle3(cylinder.Axis.Origin + scalar * cylinder.Axis.Direction, affineTransform.AxisX, affineTransform.AxisY, affineTransform.AxisZ, cylinder.Radius); Circle3 circle2 = new Circle3(cylinder.Axis.Origin - scalar * cylinder.Axis.Direction, affineTransform.AxisX, affineTransform.AxisY, affineTransform.AxisZ, cylinder.Radius); AxisAlignedBox3 axisAlignedBox = circle.ComputeAxisAlignedBoundingBox(); AxisAlignedBox3 other = circle2.ComputeAxisAlignedBoundingBox(); return(axisAlignedBox.CreateMergedWith(other)); }
// Token: 0x060003CA RID: 970 RVA: 0x00010F64 File Offset: 0x0000F164 internal static bool Test(Ray3 ray, AxisAlignedBox3 axisAlignedBox) { Vector3 vector = ray.Origin - axisAlignedBox.Center; if (Math.Abs(vector.X) > axisAlignedBox.Extents.X && vector.X * ray.Direction.X >= 0.0) { return(false); } if (Math.Abs(vector.Y) > axisAlignedBox.Extents.Y && vector.Y * ray.Direction.Y >= 0.0) { return(false); } if (Math.Abs(vector.Z) > axisAlignedBox.Extents.Z && vector.Z * ray.Direction.Z >= 0.0) { return(false); } Vector3 vector2 = ray.Direction.Cross(vector); Vector3 vector3 = new Vector3(Math.Abs(ray.Direction.X), Math.Abs(ray.Direction.Y), Math.Abs(ray.Direction.Z)); return(Math.Abs(vector2.X) <= axisAlignedBox.Extents.Y * vector3.Z + axisAlignedBox.Extents.Z * vector3.Y + 1E-08 && Math.Abs(vector2.Y) <= axisAlignedBox.Extents.Z * vector3.X + axisAlignedBox.Extents.X * vector3.Z + 1E-08 && Math.Abs(vector2.Z) <= axisAlignedBox.Extents.X * vector3.Y + axisAlignedBox.Extents.Y * vector3.X + 1E-08); }
// Token: 0x060004BB RID: 1211 RVA: 0x0001847C File Offset: 0x0001667C public static AxisAlignedBox3 Transform(this AffineTransform3 transformer, AxisAlignedBox3 input) { Vector3 vector = transformer.Transform(input.Center - input.Extents); Vector3 vector2 = vector; foreach (Vector3 right in new List <Vector3> { new Vector3(input.ExtentX, -input.ExtentY, -input.ExtentZ), new Vector3(-input.ExtentX, input.ExtentY, -input.ExtentZ), new Vector3(input.ExtentX, input.ExtentY, -input.ExtentZ), new Vector3(-input.ExtentX, -input.ExtentY, input.ExtentZ), new Vector3(input.ExtentX, -input.ExtentY, input.ExtentZ), new Vector3(-input.ExtentX, input.ExtentY, input.ExtentZ), new Vector3(input.ExtentX, input.ExtentY, input.ExtentZ) }) { Vector3 value = transformer.Transform(input.Center + right); vector = Vector3.Min(vector, value); vector2 = Vector3.Max(vector2, value); } return(new AxisAlignedBox3(vector, vector2)); }
// Token: 0x060003C9 RID: 969 RVA: 0x00010EC0 File Offset: 0x0000F0C0 public static ICollection <Vector3> IntersectionPointsWith(this Ray3 ray, AxisAlignedBox3 axisAlignedBox) { Box3 box = new Box3(axisAlignedBox.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox.ExtentX, axisAlignedBox.ExtentY, axisAlignedBox.ExtentZ); Segment3?segment = ray.IntersectionWith(box); if (segment == null) { return(new List <Vector3>()); } Segment3 value = segment.Value; if (value.Extent < 1E-08) { return(new List <Vector3> { value.Origin }); } return(new List <Vector3> { value.NegativeEnd, value.PositiveEnd }); }
// Token: 0x06000314 RID: 788 RVA: 0x0000C851 File Offset: 0x0000AA51 public static bool Intersects(this AxisAlignedBox3 axisAlignedBox3, Ray3 ray) { return(ray.Intersects(axisAlignedBox3)); }
// Token: 0x060003C8 RID: 968 RVA: 0x00010E58 File Offset: 0x0000F058 public static Segment3?IntersectionWith(this Ray3 ray, AxisAlignedBox3 axisAlignedBox) { Box3 box = new Box3(axisAlignedBox.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox.ExtentX, axisAlignedBox.ExtentY, axisAlignedBox.ExtentZ); return(Intersection.DoClipping(0.0, double.MaxValue, ray.Origin, ray.Direction, box)); }
// Token: 0x060003C7 RID: 967 RVA: 0x00010E4E File Offset: 0x0000F04E public static bool Intersects(this Ray3 ray, AxisAlignedBox3 axisAlignedBox) { return(IntersectionRay3AxisAlignedBox3.Test(ray, axisAlignedBox)); }
// Token: 0x06000315 RID: 789 RVA: 0x0000C85A File Offset: 0x0000AA5A public static Segment3?IntersectionWith(this AxisAlignedBox3 axisAlignedBox3, Ray3 ray3) { return(ray3.IntersectionWith(axisAlignedBox3)); }
// Token: 0x06000316 RID: 790 RVA: 0x0000C863 File Offset: 0x0000AA63 public static ICollection <Vector3> IntersectionPointsWith(this AxisAlignedBox3 axisAlignedBox3, Ray3 ray3) { return(ray3.IntersectionPointsWith(axisAlignedBox3)); }
// Token: 0x0600030E RID: 782 RVA: 0x0000C7DC File Offset: 0x0000A9DC public static bool Intersects(this AxisAlignedBox3 axisAlignedBox3, AxisAlignedBox3 other) { IntersectionAxisAlignedBox3AxisAlignedBox3 intersectionAxisAlignedBox3AxisAlignedBox = new IntersectionAxisAlignedBox3AxisAlignedBox3(axisAlignedBox3, other); return(intersectionAxisAlignedBox3AxisAlignedBox.Test()); }
// Token: 0x0600031C RID: 796 RVA: 0x0000C899 File Offset: 0x0000AA99 public IntersectionAxisAlignedBox3AxisAlignedBox3(AxisAlignedBox3 box0, AxisAlignedBox3 box1) { this.box0 = box0; this.box1 = box1; }
// Token: 0x06000317 RID: 791 RVA: 0x0000C86C File Offset: 0x0000AA6C public static bool Intersects(this AxisAlignedBox3 axisAlignedBox3, Segment3 segment3) { return(segment3.Intersects(axisAlignedBox3)); }
// Token: 0x06000321 RID: 801 RVA: 0x0000CB24 File Offset: 0x0000AD24 public bool Find(out AxisAlignedBox3 intersection) { if (this.box0.Max.X < this.box1.Min.X || this.box0.Min.X > this.box1.Max.X) { intersection = new AxisAlignedBox3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); return(false); } if (this.box0.Max.Y < this.box1.Min.Y || this.box0.Min.Y > this.box1.Max.Y) { intersection = new AxisAlignedBox3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); return(false); } if (this.box0.Max.Z < this.box1.Min.Z || this.box0.Min.Z > this.box1.Max.Z) { intersection = new AxisAlignedBox3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); return(false); } double maxX; if (this.box0.MaxX <= this.box1.MaxX) { maxX = this.box0.MaxX; } else { maxX = this.box1.MaxX; } double minX; if (this.box0.MinX <= this.box1.MinX) { minX = this.box1.MinX; } else { minX = this.box0.MinX; } double maxY; if (this.box0.MaxY <= this.box1.MaxY) { maxY = this.box0.MaxY; } else { maxY = this.box1.MaxY; } double minY; if (this.box0.MinY <= this.box1.MinY) { minY = this.box1.MinY; } else { minY = this.box0.MinY; } double maxZ; if (this.box0.MaxZ <= this.box1.MaxZ) { maxZ = this.box0.MaxZ; } else { maxZ = this.box1.MaxZ; } double minZ; if (this.box0.MinZ <= this.box1.MinZ) { minZ = this.box1.MinZ; } else { minZ = this.box0.MinZ; } intersection = new AxisAlignedBox3(minX, maxX, minY, maxY, minZ, maxZ); return(true); }
// Token: 0x06000410 RID: 1040 RVA: 0x00012470 File Offset: 0x00010670 public static Segment3?IntersectionWith(this Segment3 segment, AxisAlignedBox3 axisAlignedBox) { Box3 box = new Box3(axisAlignedBox.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox.ExtentX, axisAlignedBox.ExtentY, axisAlignedBox.ExtentZ); return(Intersection.DoClipping(-segment.Extent, segment.Extent, segment.Origin, segment.Direction, box)); }
// Token: 0x06000318 RID: 792 RVA: 0x0000C875 File Offset: 0x0000AA75 public static Segment3?IntersectionWith(this AxisAlignedBox3 axisAlignedBox3, Segment3 segment3) { return(segment3.IntersectionWith(axisAlignedBox3)); }
// Token: 0x0600031A RID: 794 RVA: 0x0000C887 File Offset: 0x0000AA87 public static bool Intersects(this AxisAlignedBox3 axisAlignedBox3, Triangle3 triangle3) { return(triangle3.Intersects(axisAlignedBox3)); }
// Token: 0x06000313 RID: 787 RVA: 0x0000C848 File Offset: 0x0000AA48 public static bool Intersects(this AxisAlignedBox3 axisAlignedBox3, Plane3 plane3) { return(plane3.Intersects(axisAlignedBox3)); }
// Token: 0x0600036A RID: 874 RVA: 0x0000EB4C File Offset: 0x0000CD4C public static Segment3?IntersectionWith(this Line3 line, AxisAlignedBox3 axisAlignedBox) { Box3 box = new Box3(axisAlignedBox.Center, UnitVector3.UnitX, UnitVector3.UnitY, UnitVector3.UnitZ, axisAlignedBox.ExtentX, axisAlignedBox.ExtentY, axisAlignedBox.ExtentZ); return(Intersection.DoClipping(double.MinValue, double.MaxValue, line.Origin, line.Direction, box)); }
// Token: 0x0600031B RID: 795 RVA: 0x0000C890 File Offset: 0x0000AA90 public static ICollection <Vector3> IntersectionPointsWith(this AxisAlignedBox3 axisAlignedBox3, Triangle3 triangle3) { return(triangle3.IntersectionPointsWith(axisAlignedBox3)); }
// Token: 0x06000319 RID: 793 RVA: 0x0000C87E File Offset: 0x0000AA7E public static ICollection <Vector3> IntersectionPointsWith(this AxisAlignedBox3 axisAlignedBox3, Segment3 segment3) { return(segment3.IntersectionPointsWith(axisAlignedBox3)); }