Header menu logo Nu

Box2i Type

Defines an axis-aligned 2D box (rectangle) in integers. Copied from - https://github.com/opentk/opentk/blob/opentk5.0/src/OpenTK.Mathematics/Geometry/Box2.cs Heavily modified by BGE to more closely conform to System.Numerics and use a size-preserving representation ([min, size] instead of [min, max]), as well as using integers.

Constructors

Constructor Description

Box2i(min, size)

Full Usage: Box2i(min, size)

Parameters:

Initializes a new instance of the Box2i struct.

min : Vector2i
size : Vector2i

Box2i(minX, minY, sizeX, sizeY)

Full Usage: Box2i(minX, minY, sizeX, sizeY)

Parameters:
    minX : int
    minY : int
    sizeX : int
    sizeY : int

Initializes a new instance of the Box2i struct.

minX : int
minY : int
sizeX : int
sizeY : int

Instance members

Instance member Description

this.Contains

Full Usage: this.Contains

Parameters:
Returns: ContainmentType A value indicating if this Box2i contains, intersects with or is disjoint with box.

Check if this Box2i contains another Box2i.

box : Box2i

The Box2i to test for overlap.

Returns: ContainmentType

A value indicating if this Box2i contains, intersects with or is disjoint with box.

this.Contains

Full Usage: this.Contains

Parameters:
    box : byref<Box2i> - The Box2i to test for overlap.
    result : byref<ContainmentType> - A value indicating if this Box2i contains, intersects with or is disjoint with box.

Check if this Box2i contains another Box2i.

box : byref<Box2i>

The Box2i to test for overlap.

result : byref<ContainmentType>

A value indicating if this Box2i contains, intersects with or is disjoint with box.

this.Contains

Full Usage: this.Contains

Parameters:
Returns: ContainmentType ContainmentType.Contains if this Box2i contains point or ContainmentType.Disjoint if it does not.

Check if this Box2i contains a point.

point : Vector2

The Vector3 to test.

Returns: ContainmentType

ContainmentType.Contains if this Box2i contains point or ContainmentType.Disjoint if it does not.

this.Contains

Full Usage: this.Contains

Parameters:

Check if this Box2i contains a point.

point : byref<Vector2>

The Vector2 to test.

result : byref<ContainmentType>

ContainmentType.Contains if this Box2i contains point or ContainmentType.Disjoint if it does not.

this.Equals

Full Usage: this.Equals

Parameters:
    obj : obj

Returns: bool
Modifiers: abstract
obj : obj
Returns: bool

this.Equals

Full Usage: this.Equals

Parameters:
Returns: bool
Modifiers: abstract
other : Box2i
Returns: bool

this.GetHashCode

Full Usage: this.GetHashCode

Returns: int
Modifiers: abstract
Returns: int

this.ToString

Full Usage: this.ToString

Returns: string
Modifiers: abstract
Returns: string

Static members

Static member Description

left <> right

Full Usage: left <> right

Parameters:
    left : Box2i - The left operand.
    right : Box2i - The right operand.

Returns: bool

Inequality comparator.

left : Box2i

The left operand.

right : Box2i

The right operand.

Returns: bool

left = right

Full Usage: left = right

Parameters:
    left : Box2i - The left operand.
    right : Box2i - The right operand.

Returns: bool

Equality comparator.

left : Box2i

The left operand.

right : Box2i

The right operand.

Returns: bool

Box2i.Enclose(point, point2)

Full Usage: Box2i.Enclose(point, point2)

Parameters:
Returns: Box2i

Create a bounding box by enclosing two points.

point : Vector2i
point2 : Vector2i
Returns: Box2i

Type something to start searching.