Show / Hide Table of Contents

Class BoundingBox2I

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

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

Constructors

BoundingBox2I(Vector2I, Vector2I)

Creates an instance of BoundingBox2I.

Declaration
public BoundingBox2I(Vector2I min, Vector2I max)
Parameters
Type Name Description
Vector2I min

The minimum point the BoundingBox2I includes.

Vector2I max

The maximum point the BoundingBox2I includes.

Fields

Max

The maximum point the BoundingBox2I contains.

Declaration
public Vector2I Max
Field Value
Type Description
Vector2I

Min

The minimum point the BoundingBox2I contains.

Declaration
public Vector2I Min
Field Value
Type Description
Vector2I

Properties

Center

Calculates center

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

Extents

Declaration
public Vector2I Extents { get; }
Property Value
Type Description
Vector2I

HalfExtents

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

Height

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

Size

Size

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

Width

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

Methods

Area()

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

Contains(BoundingBox2I)

Tests whether the BoundingBox2I contains another BoundingBox2I.

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

The BoundingBox2I to test for overlap.

Returns
Type Description
ContainmentType

Contains(ref BoundingBox2I, out ContainmentType)

Tests whether the BoundingBox2I contains a BoundingBox2I.

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

The BoundingBox2I to test for overlap.

ContainmentType result

[OutAttribute] Enumeration indicating the extent of overlap.

Contains(Vector2I)

Tests whether the BoundingBox2I contains a point.

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

The point to test for overlap.

Returns
Type Description
ContainmentType

Contains(ref Vector2I, out ContainmentType)

Tests whether the BoundingBox2I contains a point.

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

The point to test for overlap.

ContainmentType result

[OutAttribute] Enumeration indicating the extent of overlap.

CreateFromHalfExtent(Vector2I, Int32)

Declaration
public static BoundingBox2I CreateFromHalfExtent(Vector2I center, int halfExtent)
Parameters
Type Name Description
Vector2I center
System.Int32 halfExtent
Returns
Type Description
BoundingBox2I

CreateFromHalfExtent(Vector2I, Vector2I)

Declaration
public static BoundingBox2I CreateFromHalfExtent(Vector2I center, Vector2I halfExtent)
Parameters
Type Name Description
Vector2I center
Vector2I halfExtent
Returns
Type Description
BoundingBox2I

CreateFromPoints(IEnumerable<Vector2I>)

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

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

A list of points the BoundingBox2I should contain.

Returns
Type Description
BoundingBox2I

CreateInvalid()

Declaration
public static BoundingBox2I CreateInvalid()
Returns
Type Description
BoundingBox2I

CreateMerged(BoundingBox2I, BoundingBox2I)

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

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

One of the BoundingBox2Is to contain.

BoundingBox2I additional

One of the BoundingBox2Is to contain.

Returns
Type Description
BoundingBox2I

CreateMerged(ref BoundingBox2I, ref BoundingBox2I, out BoundingBox2I)

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

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

One of the BoundingBox2I instances to contain.

BoundingBox2I additional

One of the BoundingBox2I instances to contain.

BoundingBox2I result

[OutAttribute] The created BoundingBox2I.

Equals(Object)

Determines whether two instances of BoundingBox2I are equal.

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

The Object to compare with the current BoundingBox2I.

Returns
Type Description
System.Boolean

Equals(BoundingBox2I)

Determines whether two instances of BoundingBox2I are equal.

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

The BoundingBox2I to compare with the current BoundingBox2I.

Returns
Type Description
System.Boolean

GetCorners()

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

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

GetCorners(Vector2I[])

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

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

An existing array of at least 8 Vector2I points where the corners of the BoundingBox2I are written.

GetCornersUnsafe(Vector2I*)

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

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

An existing array of at least 8 Vector2I points where the corners of the BoundingBox2I are written.

GetHashCode()

Gets the hash code for this instance.

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

GetIncluded(Vector2I)

Declaration
public BoundingBox2I GetIncluded(Vector2I point)
Parameters
Type Name Description
Vector2I point
Returns
Type Description
BoundingBox2I

Include(BoundingBox2I)

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

Include(ref BoundingBox2I)

return expanded aabb (abb include point)

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

Include(Vector2I)

Declaration
public BoundingBox2I Include(Vector2I point)
Parameters
Type Name Description
Vector2I point
Returns
Type Description
BoundingBox2I

Include(Vector2I, Vector2I, Vector2I)

Declaration
public BoundingBox2I Include(Vector2I p0, Vector2I p1, Vector2I p2)
Parameters
Type Name Description
Vector2I p0
Vector2I p1
Vector2I p2
Returns
Type Description
BoundingBox2I

Include(ref Vector2I)

return expanded aabb (abb include point)

Declaration
public BoundingBox2I Include(ref Vector2I point)
Parameters
Type Name Description
Vector2I point
Returns
Type Description
BoundingBox2I

Include(ref Vector2I, ref Vector2I, ref Vector2I)

Declaration
public BoundingBox2I Include(ref Vector2I p0, ref Vector2I p1, ref Vector2I p2)
Parameters
Type Name Description
Vector2I p0
Vector2I p1
Vector2I p2
Returns
Type Description
BoundingBox2I

Inflate(Int32)

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

InflateToMinimum(Vector2I)

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

Intersect(BoundingBox2I)

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

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

Intersects(BoundingBox2I)

Checks whether the current BoundingBox2I intersects another BoundingBox2I.

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

The BoundingBox2I to check for intersection with.

Returns
Type Description
System.Boolean

Intersects(ref BoundingBox2I)

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

Intersects(ref BoundingBox2I, out Boolean)

Checks whether the current BoundingBox2I intersects another BoundingBox2I.

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

The BoundingBox2I to check for intersection with.

System.Boolean result

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

Perimeter()

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

Scale(Vector2I)

Declaration
public void Scale(Vector2I scale)
Parameters
Type Name Description
Vector2I scale

ToString()

Returns a String that represents the current BoundingBox2I.

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

Translate(Vector2I)

Translate

Declaration
public BoundingBox2I Translate(Vector2I vctTranlsation)
Parameters
Type Name Description
Vector2I vctTranlsation
Returns
Type Description
BoundingBox2I

Operators

Equality(BoundingBox2I, BoundingBox2I)

Determines whether two instances of BoundingBox2I are equal.

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

BoundingBox2I to compare.

BoundingBox2I b

BoundingBox2I to compare.

Returns
Type Description
System.Boolean

Inequality(BoundingBox2I, BoundingBox2I)

Determines whether two instances of BoundingBox2I are not equal.

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

The object to the left of the inequality operator.

BoundingBox2I b

The object to the right of the inequality operator.

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