Show / Hide Table of Contents

Class BoundingBoxI

Defines an axis-aligned box-shaped 3D volume.

Inheritance
System.Object
BoundingBoxI
Namespace: VRageMath
Assembly: VRage.Math.dll
Syntax
public sealed class BoundingBoxI : ValueType, IEquatable<BoundingBoxI>

Constructors

BoundingBoxI(Int32, Int32)

Creates an instance of BoundingBoxI.

Declaration
public BoundingBoxI(int min, int max)
Parameters
Type Name Description
System.Int32 min

The minimum point the BoundingBoxI includes.

System.Int32 max

The maximum point the BoundingBoxI includes.

BoundingBoxI(BoundingBox)

Creates an instance of BoundingBoxI.

Declaration
public BoundingBoxI(BoundingBox box)
Parameters
Type Name Description
BoundingBox box

BoundingBoxI(Vector3I, Vector3I)

Creates an instance of BoundingBoxI.

Declaration
public BoundingBoxI(Vector3I min, Vector3I max)
Parameters
Type Name Description
Vector3I min

The minimum point the BoundingBoxI includes.

Vector3I max

The maximum point the BoundingBoxI includes.

Fields

Max

The maximum point the BoundingBoxI contains.

Declaration
public Vector3I Max
Field Value
Type Description
Vector3I

Min

The minimum point the BoundingBoxI contains.

Declaration
public Vector3I Min
Field Value
Type Description
Vector3I

Properties

Center

Calculates center

Declaration
public Vector3I Center { get; }
Property Value
Type Description
Vector3I

HalfExtents

Declaration
public Vector3I HalfExtents { get; }
Property Value
Type Description
Vector3I

IsValid

Declaration
public bool IsValid { get; }
Property Value
Type Description
System.Boolean

Perimeter

return perimeter of edges

Declaration
public float Perimeter { get; }
Property Value
Type Description
System.Single

Size

Size

Declaration
public Vector3I Size { get; }
Property Value
Type Description
Vector3I

Methods

Contains(BoundingBoxI)

Tests whether the BoundingBoxI contains another BoundingBoxI.

Declaration
public ContainmentType Contains(BoundingBoxI box)
Parameters
Type Name Description
BoundingBoxI box

The BoundingBoxI to test for overlap.

Returns
Type Description
ContainmentType

Contains(ref BoundingBoxI, out ContainmentType)

Tests whether the BoundingBoxI contains a BoundingBoxI.

Declaration
public void Contains(ref BoundingBoxI box, out ContainmentType result)
Parameters
Type Name Description
BoundingBoxI box

The BoundingBoxI to test for overlap.

ContainmentType result

[OutAttribute] Enumeration indicating the extent of overlap.

Contains(Vector3)

Declaration
public ContainmentType Contains(Vector3 point)
Parameters
Type Name Description
Vector3 point
Returns
Type Description
ContainmentType

Contains(Vector3I)

Tests whether the BoundingBoxI contains a point.

Declaration
public ContainmentType Contains(Vector3I point)
Parameters
Type Name Description
Vector3I point

The point to test for overlap.

Returns
Type Description
ContainmentType

Contains(ref Vector3I, out ContainmentType)

Tests whether the BoundingBoxI contains a point.

Declaration
public void Contains(ref Vector3I point, out ContainmentType result)
Parameters
Type Name Description
Vector3I point

The point to test for overlap.

ContainmentType result

[OutAttribute] Enumeration indicating the extent of overlap.

CreateFromPoints(IEnumerable<Vector3I>)

Creates the smallest BoundingBoxI that will contain a group of points.

Declaration
public static BoundingBoxI CreateFromPoints(IEnumerable<Vector3I> points)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Vector3I> points

A list of points the BoundingBoxI should contain.

Returns
Type Description
BoundingBoxI

CreateFromSphere(BoundingSphere)

Creates the smallest BoundingBoxI that will contain the specified BoundingSphere.

Declaration
public static BoundingBoxI CreateFromSphere(BoundingSphere sphere)
Parameters
Type Name Description
BoundingSphere sphere

The BoundingSphere to contain.

Returns
Type Description
BoundingBoxI

CreateFromSphere(ref BoundingSphere, out BoundingBoxI)

Creates the smallest BoundingBoxI that will contain the specified BoundingSphere.

Declaration
public static void CreateFromSphere(ref BoundingSphere sphere, out BoundingBoxI result)
Parameters
Type Name Description
BoundingSphere sphere

The BoundingSphere to contain.

BoundingBoxI result

[OutAttribute] The created BoundingBoxI.

CreateInvalid()

Declaration
public static BoundingBoxI CreateInvalid()
Returns
Type Description
BoundingBoxI

CreateMerged(BoundingBoxI, BoundingBoxI)

Creates the smallest BoundingBoxI that contains the two specified BoundingBoxI instances.

Declaration
public static BoundingBoxI CreateMerged(BoundingBoxI original, BoundingBoxI additional)
Parameters
Type Name Description
BoundingBoxI original

One of the BoundingBoxIs to contain.

BoundingBoxI additional

One of the BoundingBoxIs to contain.

Returns
Type Description
BoundingBoxI

CreateMerged(ref BoundingBoxI, ref BoundingBoxI, out BoundingBoxI)

Creates the smallest BoundingBoxI that contains the two specified BoundingBoxI instances.

Declaration
public static void CreateMerged(ref BoundingBoxI original, ref BoundingBoxI additional, out BoundingBoxI result)
Parameters
Type Name Description
BoundingBoxI original

One of the BoundingBoxI instances to contain.

BoundingBoxI additional

One of the BoundingBoxI instances to contain.

BoundingBoxI result

[OutAttribute] The created BoundingBoxI.

Distance(Vector3I)

Declaration
public float Distance(Vector3I point)
Parameters
Type Name Description
Vector3I point
Returns
Type Description
System.Single

EnumeratePoints(BoundingBoxI)

Enumerate all values in a integer interval (a cuboid).

This method is an allocating version of the Vector3I_RangeIterator. This once can be used in the foreach syntax though so it's more convenient for debug routines.

Declaration
public static IEnumerable<Vector3I> EnumeratePoints(BoundingBoxI rangeInclusive)
Parameters
Type Name Description
BoundingBoxI rangeInclusive
Returns
Type Description
System.Collections.Generic.IEnumerable<Vector3I>

An iterator for that range.

Equals(Object)

Determines whether two instances of BoundingBoxI are equal.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The Object to compare with the current BoundingBoxI.

Returns
Type Description
System.Boolean

Equals(BoundingBoxI)

Determines whether two instances of BoundingBoxI are equal.

Declaration
public bool Equals(BoundingBoxI other)
Parameters
Type Name Description
BoundingBoxI other

The BoundingBoxI to compare with the current BoundingBoxI.

Returns
Type Description
System.Boolean

GetCorners()

Gets an array of points that make up the corners of the BoundingBoxI.

Declaration
public Vector3I[] GetCorners()
Returns
Type Description
Vector3I[]

GetCorners(Vector3I[])

Gets the array of points that make up the corners of the BoundingBoxI.

Declaration
public void GetCorners(Vector3I[] corners)
Parameters
Type Name Description
Vector3I[] corners

An existing array of at least 8 Vector3I points where the corners of the BoundingBoxI are written.

GetCornersUnsafe(Vector3I*)

Gets the array of points that make up the corners of the BoundingBoxI.

Declaration
public void GetCornersUnsafe(Vector3I*corners)
Parameters
Type Name Description
Vector3I* corners

An existing array of at least 8 Vector3I points where the corners of the BoundingBoxI are written.

GetHashCode()

Gets the hash code for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

GetIncluded(Vector3I)

Declaration
public BoundingBoxI GetIncluded(Vector3I point)
Parameters
Type Name Description
Vector3I point
Returns
Type Description
BoundingBoxI

Include(BoundingBoxI)

Declaration
public BoundingBoxI Include(BoundingBoxI box)
Parameters
Type Name Description
BoundingBoxI box
Returns
Type Description
BoundingBoxI

Include(ref BoundingBoxI)

return expanded aabb (abb include point)

Declaration
public BoundingBoxI Include(ref BoundingBoxI box)
Parameters
Type Name Description
BoundingBoxI box
Returns
Type Description
BoundingBoxI

Include(Vector3I)

Declaration
public BoundingBoxI Include(Vector3I point)
Parameters
Type Name Description
Vector3I point
Returns
Type Description
BoundingBoxI

Include(Vector3I, Vector3I, Vector3I)

Declaration
public BoundingBoxI Include(Vector3I p0, Vector3I p1, Vector3I p2)
Parameters
Type Name Description
Vector3I p0
Vector3I p1
Vector3I p2
Returns
Type Description
BoundingBoxI

Include(ref Vector3I)

return expanded aabb (abb include point)

Declaration
public BoundingBoxI Include(ref Vector3I point)
Parameters
Type Name Description
Vector3I point
Returns
Type Description
BoundingBoxI

Include(ref Vector3I, ref Vector3I, ref Vector3I)

Declaration
public BoundingBoxI Include(ref Vector3I p0, ref Vector3I p1, ref Vector3I p2)
Parameters
Type Name Description
Vector3I p0
Vector3I p1
Vector3I p2
Returns
Type Description
BoundingBoxI

Inflate(Int32)

Declaration
public void Inflate(int size)
Parameters
Type Name Description
System.Int32 size

InflateToMinimum(Vector3I)

Declaration
public void InflateToMinimum(Vector3I minimumSize)
Parameters
Type Name Description
Vector3I minimumSize

Intersect(BoundingBoxI)

Returns bounding box which is intersection of this and box
Result is invalid box when there's no intersection (Min > Max)

Declaration
public BoundingBoxI Intersect(BoundingBoxI box)
Parameters
Type Name Description
BoundingBoxI box
Returns
Type Description
BoundingBoxI

Intersects(BoundingBoxI)

Checks whether the current BoundingBoxI intersects another BoundingBoxI.

Declaration
public bool Intersects(BoundingBoxI box)
Parameters
Type Name Description
BoundingBoxI box

The BoundingBoxI to check for intersection with.

Returns
Type Description
System.Boolean

Intersects(ref BoundingBoxI)

Declaration
public bool Intersects(ref BoundingBoxI box)
Parameters
Type Name Description
BoundingBoxI box
Returns
Type Description
System.Boolean

Intersects(ref BoundingBoxI, out Boolean)

Checks whether the current BoundingBoxI intersects another BoundingBoxI.

Declaration
public void Intersects(ref BoundingBoxI box, out bool result)
Parameters
Type Name Description
BoundingBoxI box

The BoundingBoxI to check for intersection with.

System.Boolean result

[OutAttribute] true if the BoundingBoxI instances intersect; false otherwise.

Intersects(Line, out Single)

Declaration
public bool Intersects(Line line, out float distance)
Parameters
Type Name Description
Line line
System.Single distance
Returns
Type Description
System.Boolean

Intersects(Plane)

Checks whether the current BoundingBoxI intersects a Plane.

Declaration
public PlaneIntersectionType Intersects(Plane plane)
Parameters
Type Name Description
Plane plane

The Plane to check for intersection with.

Returns
Type Description
PlaneIntersectionType

Intersects(ref Plane, out PlaneIntersectionType)

Checks whether the current BoundingBoxI intersects a Plane.

Declaration
public void Intersects(ref Plane plane, out PlaneIntersectionType result)
Parameters
Type Name Description
Plane plane

The Plane to check for intersection with.

PlaneIntersectionType result

[OutAttribute] An enumeration indicating whether the BoundingBoxI intersects the Plane.

Intersects(Ray)

Checks whether the current BoundingBoxI intersects a Ray.

Declaration
public Nullable<float> Intersects(Ray ray)
Parameters
Type Name Description
Ray ray

The Ray to check for intersection with.

Returns
Type Description
System.Nullable<System.Single>

Intersects(ref Ray, out Nullable<Single>)

Checks whether the current BoundingBoxI intersects a Ray.

Declaration
public void Intersects(ref Ray ray, out Nullable<float> result)
Parameters
Type Name Description
Ray ray

The Ray to check for intersection with.

System.Nullable<System.Single> result

[OutAttribute] Distance at which the ray intersects the BoundingBoxI, or null if there is no intersection.

IntersectsTriangle(Vector3I, Vector3I, Vector3I)

Declaration
public bool IntersectsTriangle(Vector3I v0, Vector3I v1, Vector3I v2)
Parameters
Type Name Description
Vector3I v0
Vector3I v1
Vector3I v2
Returns
Type Description
System.Boolean

IntersectsTriangle(ref Vector3I, ref Vector3I, ref Vector3I)

Declaration
public bool IntersectsTriangle(ref Vector3I v0, ref Vector3I v1, ref Vector3I v2)
Parameters
Type Name Description
Vector3I v0
Vector3I v1
Vector3I v2
Returns
Type Description
System.Boolean

IntersectWith(ref BoundingBoxI)

Returns bounding box which is intersection of this and box
Result is invalid box when there's no intersection (Min > Max)

Declaration
public void IntersectWith(ref BoundingBoxI box)
Parameters
Type Name Description
BoundingBoxI box

IterateDifference(BoundingBoxI, BoundingBoxI)

Iterate every cell contained in {left} - {right}, where we interpret {box} as the set of all distinct Vector3I points inside a 'box'.

Containment is taken in a typical inclusive start, exclusive end fashion.

Declaration
public static IEnumerable<Vector3I> IterateDifference(BoundingBoxI left, BoundingBoxI right)
Parameters
Type Name Description
BoundingBoxI left

The left bounding box.

BoundingBoxI right

The right bounding box.

Returns
Type Description
System.Collections.Generic.IEnumerable<Vector3I>

SurfaceArea()

Declaration
public float SurfaceArea()
Returns
Type Description
System.Single

ToString()

Returns a String that represents the current BoundingBoxI.

Declaration
public override string ToString()
Returns
Type Description
System.String

Translate(Vector3I)

Translate

Declaration
public BoundingBoxI Translate(Vector3I vctTranlsation)
Parameters
Type Name Description
Vector3I vctTranlsation
Returns
Type Description
BoundingBoxI

Volume()

Declaration
public float Volume()
Returns
Type Description
System.Single

Operators

Equality(BoundingBoxI, BoundingBoxI)

Determines whether two instances of BoundingBoxI are equal.

Declaration
public static bool operator ==(BoundingBoxI a, BoundingBoxI b)
Parameters
Type Name Description
BoundingBoxI a

BoundingBoxI to compare.

BoundingBoxI b

BoundingBoxI to compare.

Returns
Type Description
System.Boolean

Explicit(BoundingBox to BoundingBoxI)

Declaration
public static explicit operator BoundingBoxI(BoundingBox box)
Parameters
Type Name Description
BoundingBox box
Returns
Type Description
BoundingBoxI

Explicit(BoundingBoxD to BoundingBoxI)

Declaration
public static explicit operator BoundingBoxI(BoundingBoxD box)
Parameters
Type Name Description
BoundingBoxD box
Returns
Type Description
BoundingBoxI

Inequality(BoundingBoxI, BoundingBoxI)

Determines whether two instances of BoundingBoxI are not equal.

Declaration
public static bool operator !=(BoundingBoxI a, BoundingBoxI b)
Parameters
Type Name Description
BoundingBoxI a

The object to the left of the inequality operator.

BoundingBoxI b

The object to the right of the inequality operator.

Returns
Type Description
System.Boolean
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾