Header menu logo Nu

Box3 Type

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

Constructors

Constructor Description

Box3(min, size)

Full Usage: Box3(min, size)

Parameters:

Initializes a new instance of the Box3 struct.

min : Vector3
size : Vector3

Box3(minX, minY, minZ, sizeX, sizeY, sizeZ)

Full Usage: Box3(minX, minY, minZ, sizeX, sizeY, sizeZ)

Parameters:
    minX : float32
    minY : float32
    minZ : float32
    sizeX : float32
    sizeY : float32
    sizeZ : float32

Initializes a new instance of the Box3 struct.

minX : float32
minY : float32
minZ : float32
sizeX : float32
sizeY : float32
sizeZ : float32

Instance members

Instance member Description

this.Combine

Full Usage: this.Combine

Parameters:
Returns: Box3 Box containing area of both.

Combine area of box with a point.

point : Vector3
Returns: Box3

Box containing area of both.

this.Combine

Full Usage: this.Combine

Parameters:
Returns: Box3 Box containing area of both.

Combine area of two boxes.

box : Box3

Returns: Box3

Box containing area of both.

this.Contains

Full Usage: this.Contains

Parameters:
    box : Box3 - The Box3 to test for overlap.

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

Check if this Box3 contains another Box3.

box : Box3

The Box3 to test for overlap.

Returns: ContainmentType

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

this.Contains

Full Usage: this.Contains

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

Check if this Box3 contains another Box3.

box : byref<Box3>

The Box3 to test for overlap.

result : byref<ContainmentType>

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

this.Contains

Full Usage: this.Contains

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

Check if this Box3 contains a Sphere.

sphere : Sphere

The Sphere to test for overlap.

Returns: ContainmentType

A value indicating if this Box3 contains, intersects with or is disjoint with sphere.

this.Contains

Full Usage: this.Contains

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

Check if this Box3 contains a Sphere.

sphere : byref<Sphere>

The Sphere to test for overlap.

result : byref<ContainmentType>

A value indicating if this Box3 contains, intersects with or is disjoint with sphere.

this.Contains

Full Usage: this.Contains

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

Check if this Box3 contains a point.

point : Vector3

The Vector3 to test.

Returns: ContainmentType

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

this.Contains

Full Usage: this.Contains

Parameters:

Check if this Box3 contains a point.

point : byref<Vector3>

The Vector3 to test.

result : byref<ContainmentType>

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

this.ContainsExclusive

Full Usage: this.ContainsExclusive

Parameters:
    box : Box3 - The Box3 to test for overlap.

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

Check if this Box3 contains another Box3 AND no box outside of this box intersects with it.

box : Box3

The Box3 to test for overlap.

Returns: ContainmentType

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

this.ContainsExclusive

Full Usage: this.ContainsExclusive

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

Check if this Box3 contains another Box3 AND no box outside of this box intersects with it.

box : byref<Box3>

The Box3 to test for overlap.

result : byref<ContainmentType>

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

this.Corners

Full Usage: this.Corners

Returns: Vector3[] An array of Vector3 containing the corners of this Box3.

Get an array of Vector3 containing the corners of this Box3.

Returns: Vector3[]

An array of Vector3 containing the corners of this Box3.

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 : Box3
Returns: bool

this.FaceCenters

Full Usage: this.FaceCenters

Returns: Vector3[] An array of Vector3 containing the face centers of this Box3.

Get an array of Vector3 containing the face centers of this Box3.

Returns: Vector3[]

An array of Vector3 containing the face centers of this Box3.

this.GetHashCode

Full Usage: this.GetHashCode

Returns: int
Modifiers: abstract
Returns: int

this.Intersects

Full Usage: this.Intersects

Parameters:
Returns: bool
true
if this Box3 intersects point,
false
if it does not.

Check if this Box3 is intersected by a Vector3.

point : Vector3

The Vector3 to test for intersection.

Returns: bool

true
if this Box3 intersects point,
false
if it does not.

this.Intersects

Full Usage: this.Intersects

Parameters:
    point : inref<Vector3> - The Vector3 to test for intersection.
    result : byref<bool> -
    true
    
    if this Box3 intersects point,
    false
    
    if it does not.


Check if this Box3 is intersected by a Vector3.

point : inref<Vector3>

The Vector3 to test for intersection.

result : byref<bool>

true
if this Box3 intersects point,
false
if it does not.

this.Intersects

Full Usage: this.Intersects

Parameters:
    box : Box3 - The Box3 to test for intersection.

Returns: bool
true
if this Box3 intersects box,
false
if it does not.

Check if this Box3 intersects another Box3.

box : Box3

The Box3 to test for intersection.

Returns: bool

true
if this Box3 intersects box,
false
if it does not.

this.Intersects

Full Usage: this.Intersects

Parameters:
    box : inref<Box3> - The Box3 to test for intersection.
    result : byref<bool> -
    true
    
    if this Box3 intersects box,
    false
    
    if it does not.


Check if this Box3 intersects another Box3.

box : inref<Box3>

The Box3 to test for intersection.

result : byref<bool>

true
if this Box3 intersects box,
false
if it does not.

this.Intersects

Full Usage: this.Intersects

Parameters:
Returns: bool
true
if this Box3 intersects sphere,
false
if it does not.

Check if this Box3 intersects a Frustum.

sphere : Sphere

The Frustum to test for intersection.

Returns: bool

true
if this Box3 intersects sphere,
false
if it does not.

this.Intersects

Full Usage: this.Intersects

Parameters:
    sphere : inref<Sphere> - The Frustum to test for intersection.
    result : byref<bool> -
    true
    
    if this Box3 intersects sphere,
    false
    
    if it does not.


Check if this Box3 intersects a Frustum.

sphere : inref<Sphere>

The Frustum to test for intersection.

result : byref<bool>

true
if this Box3 intersects sphere,
false
if it does not.

this.Intersects

Full Usage: this.Intersects

Parameters:
Returns: PlaneIntersectionType
true
if this Box3 intersects plane,
false
if it does not.

Check if this Box3 intersects a Plane3.

plane : Plane3

The Plane3 to test for intersection.

Returns: PlaneIntersectionType

true
if this Box3 intersects plane,
false
if it does not.

this.Intersects

Full Usage: this.Intersects

Parameters:

Check if this Box3 intersects a Plane3.

plane : inref<Plane3>

The Plane3 to test for intersection.

result : byref<PlaneIntersectionType>

true
if this Box3 intersects plane,
false
if it does not.

this.ScaleUniform

Full Usage: this.ScaleUniform

Parameters:
    scalar : float32

Returns: Box3

Resize the box by a scalar factor while keeping its center fixed.

scalar : float32
Returns: Box3

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 : Box3 - The left operand.
    right : Box3 - The right operand.

Returns: bool

Inequality comparator.

left : Box3

The left operand.

right : Box3

The right operand.

Returns: bool

left = right

Full Usage: left = right

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

Returns: bool

Equality comparator.

left : Box3

The left operand.

right : Box3

The right operand.

Returns: bool

Box3.Enclose(point, point2)

Full Usage: Box3.Enclose(point, point2)

Parameters:
Returns: Box3

Create a bounding box by enclosing two points.

point : Vector3
point2 : Vector3
Returns: Box3

Box3.Enclose(points)

Full Usage: Box3.Enclose(points)

Parameters:
Returns: Box3

Create a bounding box by enclosing multiple points.

points : Vector3[]
Returns: Box3

Type something to start searching.