Show / Hide Table of Contents

Struct BoundingBox

Axis-aligned bounding box

Namespace: ABB.Robotics.Math
Assembly: ABB.Robotics.Math.dll
Syntax
public struct BoundingBox

Constructors

View Source

BoundingBox(Vector3, Vector3)

Creates a bounding box from min and max

Declaration
public BoundingBox(Vector3 min, Vector3 max)
Parameters
Type Name Description
Vector3 min
Vector3 max

Fields

View Source

Empty

Empty (invalid) bounding box

Declaration
public static readonly BoundingBox Empty
Field Value
Type Description
BoundingBox
View Source

max

min/max corners of the box.

Declaration
public Vector3 max
Field Value
Type Description
Vector3
View Source

min

min/max corners of the box.

Declaration
public Vector3 min
Field Value
Type Description
Vector3

Properties

View Source

LongestSide

Returns the longest extent of this.

Declaration
public double LongestSide { get; }
Property Value
Type Description
double

Methods

View Source

Center()

Returns the center point of this

Declaration
public Vector3 Center()
Returns
Type Description
Vector3
View Source

Contains(BoundingBox)

Checks if box is contained by this box

Declaration
public bool Contains(BoundingBox box)
Parameters
Type Name Description
BoundingBox box
Returns
Type Description
bool
View Source

Contains(Vector3)

Checks if a point is inside this box

Declaration
public bool Contains(Vector3 point)
Parameters
Type Name Description
Vector3 point
Returns
Type Description
bool
View Source

Corners()

Returns the eight corners of this.

Declaration
public Vector3[] Corners()
Returns
Type Description
Vector3[]
View Source

Diameter()

Returns the distance between min and max corners

Declaration
public double Diameter()
Returns
Type Description
double
View Source

Distance(BoundingBox, BoundingBox)

Returns the distance between two bounding boxes.

Declaration
public static double Distance(BoundingBox lhs, BoundingBox rhs)
Parameters
Type Name Description
BoundingBox lhs
BoundingBox rhs
Returns
Type Description
double
View Source

Distance(Vector3)

Returns the distance between this BoundingBox and a point.

Declaration
public double Distance(Vector3 point)
Parameters
Type Name Description
Vector3 point
Returns
Type Description
double
Remarks

Returns 0 if the point is inside the box.

View Source

Equals(object)

Determines whether this instance and the specified object are equal

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool
Overrides
ValueType.Equals(object)
View Source

Expand(double)

Returns a BoundingBox expanded by an amount in all directions.

Declaration
public BoundingBox Expand(double amount)
Parameters
Type Name Description
double amount
Returns
Type Description
BoundingBox
View Source

GetHashCode()

Returns the hash code for this object.

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
ValueType.GetHashCode()
View Source

Intersect(BoundingBox)

Returns the interection of this and a second BoundingBox

Declaration
public BoundingBox Intersect(BoundingBox other)
Parameters
Type Name Description
BoundingBox other
Returns
Type Description
BoundingBox
View Source

Intersects(BoundingBox, BoundingBox)

Returns true if two bounding boxes intersect

Declaration
public static bool Intersects(BoundingBox lhs, BoundingBox rhs)
Parameters
Type Name Description
BoundingBox lhs
BoundingBox rhs
Returns
Type Description
bool
View Source

Intersects(BoundingBox, BoundingBox, double)

Returns true if two bounding boxes intersect.

Declaration
public static bool Intersects(BoundingBox lhs, BoundingBox rhs, double tolerance)
Parameters
Type Name Description
BoundingBox lhs
BoundingBox rhs
double tolerance
Returns
Type Description
bool
View Source

Intersects(Ray)

Returns true if a ray intersects the bounding box.

Declaration
public bool Intersects(Ray ray)
Parameters
Type Name Description
Ray ray
Returns
Type Description
bool
View Source

IsValid()

Checks if this is a valid bounding box.

Declaration
public bool IsValid()
Returns
Type Description
bool
View Source

ToString()

Returns a string representation of this instance

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
ValueType.ToString()
View Source

TransformAffine(Matrix4)

Returns a bounding box that is the result of an affine transformation

Declaration
public BoundingBox TransformAffine(Matrix4 matrix)
Parameters
Type Name Description
Matrix4 matrix
Returns
Type Description
BoundingBox
View Source

Volume()

Returns the volume of this

Declaration
public double Volume()
Returns
Type Description
double

Operators

View Source

operator +(BoundingBox, BoundingBox)

Addition operator

Declaration
public static BoundingBox operator +(BoundingBox lhs, BoundingBox rhs)
Parameters
Type Name Description
BoundingBox lhs
BoundingBox rhs
Returns
Type Description
BoundingBox

A bounding box that contains both operands

View Source

operator +(BoundingBox, Vector3)

Addition operator

Declaration
public static BoundingBox operator +(BoundingBox lhs, Vector3 rhs)
Parameters
Type Name Description
BoundingBox lhs
Vector3 rhs
Returns
Type Description
BoundingBox

A bounding box that contains both operands

View Source

operator ==(BoundingBox, BoundingBox)

Equality operator

Declaration
public static bool operator ==(BoundingBox lhs, BoundingBox rhs)
Parameters
Type Name Description
BoundingBox lhs
BoundingBox rhs
Returns
Type Description
bool
View Source

operator !=(BoundingBox, BoundingBox)

Inequality operator

Declaration
public static bool operator !=(BoundingBox lhs, BoundingBox rhs)
Parameters
Type Name Description
BoundingBox lhs
BoundingBox rhs
Returns
Type Description
bool
  • View Source
In this article
Back to top Copyright © 2025 ABB