# [−][src]Struct ncollide2d::bounding_volume::AABB

`pub struct AABB<N: RealField> { /* fields omitted */ }`

An Axis Aligned Bounding Box.

## Methods

### `impl<N: RealField> AABB<N>`[src]

#### `pub fn new(mins: Point<N>, maxs: Point<N>) -> AABB<N>`[src]

Creates a new AABB.

# Arguments:

• `mins` - position of the point with the smallest coordinates.
• `maxs` - position of the point with the highest coordinates. Each component of `mins` must be smaller than the related components of `maxs`.

#### `pub fn from_half_extents(center: Point<N>, half_extents: Vector<N>) -> Self`[src]

Creates a new AABB from its scenter and its half-extents.

#### `pub fn mins(&self) -> &Point<N>`[src]

Reference to the AABB point with the smallest components along each axis.

#### `pub fn maxs(&self) -> &Point<N>`[src]

Reference to the AABB point with the biggest components along each axis.

#### `pub fn center(&self) -> Point<N>`[src]

The center of this AABB.

#### `pub fn half_extents(&self) -> Vector<N>`[src]

The half extents of this AABB.

#### `pub fn extents(&self) -> Vector<N>`[src]

The extents of this AABB.

#### `pub fn transform_by(&self, m: &Isometry<N>) -> Self`[src]

Computes the AABB bounding `self` transformed by `m`.

#### `pub fn bounding_sphere(&self) -> BoundingSphere<N>`[src]

The smallest bounding sphere containing this AABB.

### `impl<N: RealField> AABB<N>`[src]

#### `pub fn clip_line_parameters(    &self,     orig: &Point<N>,     dir: &Vector<N>) -> Option<(N, N)>`[src]

Computes the parameters of the two intersection points between a line and this AABB.

The parameters are such that the point are given by `orig + dir * parameter`. Returns `None` if there is no intersection.

#### `pub fn clip_line(&self, orig: &Point<N>, dir: &Vector<N>) -> Option<Segment<N>>`[src]

Computes the intersection segment between a line and this AABB.

Returns `None` if there is no intersection.

#### `pub fn clip_ray_parameters(&self, ray: &Ray<N>) -> Option<(N, N)>`[src]

Computes the parameters of the two intersection points between a ray and this AABB.

The parameters are such that the point are given by `ray.orig + ray.dir * parameter`. Returns `None` if there is no intersection.

#### `pub fn clip_ray(&self, ray: &Ray<N>) -> Option<Segment<N>>`[src]

Computes the intersection segment between a ray and this AABB.

Returns `None` if there is no intersection.

## Trait Implementations

### `impl<'a, N: RealField, S: CompositeShape<N> + PointQuery<N>> BestFirstVisitor<N, usize, AABB<N>> for CompositeClosestPointVisitor<'a, N, S>`[src]

#### `type Result = PointProjection<N>`

The result of a best-first traversal.

## Blanket Implementations

### `impl<T> Same<T> for T`

#### `type Output = T`

Should always be `Self`

### `impl<T> ToOwned for T where    T: Clone, `[src]

#### `type Owned = T`

The resulting type after obtaining ownership.

### `impl<T, U> TryFrom<U> for T where    U: Into<T>, `[src]

#### `type Error = Infallible`

The type returned in the event of a conversion error.

### `impl<T, U> TryInto<U> for T where    U: TryFrom<T>, `[src]

#### `type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.