pub struct AxisAlignedBoundingBox { /* private fields */ }
Expand description

A bounding box that aligns with the x, y and z axes.

Implementations

An empty bounding box.

An infinitely large bounding box.

Constructs a new bounding box and expands it such that all of the given positions are contained inside the bounding box.

Constructs a new bounding box and expands it such that all of the given positions transformed with the given transformation are contained inside the bounding box. A position consisting of an x, y and z coordinate corresponds to three consecutive value in the positions array.

Returns true if the bounding box is empty (ie. constructed by AxisAlignedBoundingBox::EMPTY).

Returns true if the bounding box is infinitely large (ie. constructed by AxisAlignedBoundingBox::INFINITE).

Get the minimum coordinate of the bounding box.

Get the maximum coordinate of the bounding box.

Get the center of the bounding box.

Get the size of the bounding box.

Expands the bounding box such that all of the given positions are contained inside the bounding box. A position consisting of an x, y and z coordinate corresponds to three consecutive value in the positions array.

Expands the bounding box such that all of the given positions transformed with the given transformation are contained inside the bounding box. A position consisting of an x, y and z coordinate corresponds to three consecutive value in the positions array.

Expand the bounding box such that it also contains the given other bounding box.

Transforms the bounding box by the given transformation.

Note: Use new_with_transformed_positions instead of new_with_positions followed by this method to create a more tight bounding box.

The distance from position to the point in this bounding box that is closest to position.

The distance from position to the point in this bounding box that is furthest away from position.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.