Box3D

Description

struct Tinman.Terrain.Util.Box3D

A three-dimensional bounding box with 64-bit floating-point precision.

The coordinates refer to infinitesimal points (pixel-is-point semantic).

Public / Constants

Empty


public static readonly attribute Empty → (Box3D)

An empty bounding box at the coordinate origin.

See also

Box3D.IsEmpty

Inverse


public static readonly attribute Inverse → (Box3D)

An inverse bounding box that can be used as the initial value for computing bounds via subsequent calls to Grow.

See also

Box3D.IsInverse

Max


public static readonly attribute Max → (Box3D)

The largest possible box.

Note that the dimension of this box cannot be represented with regular 64-bit floating point numbers and will instead be positive infinity.

Public / Constructors

From​Points

2 overloads


[Pure]
public static method FromPoints1 → (6)

x1 in : float64

X-coordinate of first corner point.

y1 in : float64

Y-coordinate of first corner point.

z1 in : float64

Z-coordinate of first corner point.

x2 in : float64

X-coordinate of second corner point.

y2 in : float64

Y-coordinate of second corner point.

z2 in : float64

Z-coordinate of second corner point.

returns → Box3D

The bounding box.

Creates a new instance of Box3D from the given corner points.


[Pure]
public static method FromPoints2 → (2)

in : Vec3D

First corner point.

in : Vec3D

Second corner point.

returns → Box3D

The bounding box.

Creates a new instance of Box3D from the given corner points.

From​Rect


[Pure]
public static method FromRect → (6)

in : float64

X-coordinate of top-left-front corner of cuboid.

in : float64

Y-coordinate of top-left-front corner of cuboid.

in : float64

Z-coordinate of top-left-front corner of cuboid.

width in : float64

Width of cuboid.

height in : float64

Height of cuboid.

depth in : float64

Depth of cuboid.

returns → Box3D

The bounding box.

Creates a new instance of Box3D from the given rectangular cuboid.

Public / Methods

Check​Intersection

3 overloads


[Pure]
public method CheckIntersection2 → (2)

box in : Box3D

The other bounding box.

toBox in : AffineTransform

The transformation from this bounding box to the given one.

returns → bool

true if the bounding boxes intersect each other,
false if the bounding boxes do not intersect.

Checks the intersection between this bounding box and the given one.


[Pure]
public method CheckIntersection3 → (2)

ray in : Ray

The ray.

maximum opt : float64 = Maths.MaxDouble

The maximum ray distance to check.

returns → bool

true if the ray hits this bounding box, false if not.

Checks the intersection between this bounding box and the given ray.

Public / Attributes

X1


public readonly attribute X1 → (float64)

X-coordinate of minimum corner of bounding box.

X2


public readonly attribute X2 → (float64)

X-coordinate of maximum corner of bounding box.

Y1


public readonly attribute Y1 → (float64)

Y-coordinate of minimum corner of bounding box.

Y2


public readonly attribute Y2 → (float64)

Y-coordinate of maximum corner of bounding box.

Z1


public readonly attribute Z1 → (float64)

Z-coordinate of minimum corner of bounding box.

Z2


public readonly attribute Z2 → (float64)

Z-coordinate of maximum corner of bounding box.

Serialization

Serializer


public static readonly attribute Serializer → (ITypeSerializer<Box3D>)

The serialization helper object for values of Box3D.