Class BoundingBox2I
Defines an axis-aligned box-shaped 3D volume.
Inheritance
System.Object
BoundingBox2I
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
Field Value
Min
The minimum point the BoundingBox2I contains.
Declaration
Field Value
Properties
Center
Declaration
public Vector2I Center { get; }
Property Value
Extents
Declaration
public Vector2I Extents { get; }
Property Value
HalfExtents
Declaration
public Vector2I HalfExtents { get; }
Property Value
Height
Declaration
public float Height { get; }
Property Value
Type |
Description |
System.Single |
|
Size
Declaration
public Vector2I Size { get; }
Property Value
Width
Declaration
public float Width { get; }
Property Value
Type |
Description |
System.Single |
|
Methods
Area()
Declaration
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
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
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
CreateFromHalfExtent(Vector2I, Vector2I)
Declaration
public static BoundingBox2I CreateFromHalfExtent(Vector2I center, Vector2I halfExtent)
Parameters
Returns
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
CreateInvalid()
Declaration
public static BoundingBox2I CreateInvalid()
Returns
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
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
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
Returns
Include(BoundingBox2I)
Declaration
public BoundingBox2I Include(BoundingBox2I box)
Parameters
Returns
Include(ref BoundingBox2I)
return expanded aabb (abb include point)
Declaration
public BoundingBox2I Include(ref BoundingBox2I box)
Parameters
Returns
Include(Vector2I)
Declaration
public BoundingBox2I Include(Vector2I point)
Parameters
Returns
Include(Vector2I, Vector2I, Vector2I)
Declaration
public BoundingBox2I Include(Vector2I p0, Vector2I p1, Vector2I p2)
Parameters
Returns
Include(ref Vector2I)
return expanded aabb (abb include point)
Declaration
public BoundingBox2I Include(ref Vector2I point)
Parameters
Returns
Include(ref Vector2I, ref Vector2I, ref Vector2I)
Declaration
public BoundingBox2I Include(ref Vector2I p0, ref Vector2I p1, ref Vector2I p2)
Parameters
Returns
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
Returns
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
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
Returns
Type |
Description |
System.Single |
|
Scale(Vector2I)
Declaration
public void Scale(Vector2I scale)
Parameters
ToString()
Returns a String that represents the current BoundingBox2I.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Translate(Vector2I)
Declaration
public BoundingBox2I Translate(Vector2I vctTranlsation)
Parameters
Type |
Name |
Description |
Vector2I |
vctTranlsation |
|
Returns
Operators
Equality(BoundingBox2I, BoundingBox2I)
Determines whether two instances of BoundingBox2I are equal.
Declaration
public static bool operator ==(BoundingBox2I a, BoundingBox2I b)
Parameters
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 |
|