Skip to main content

BoundingBox

Struct BoundingBox 

Source
pub struct BoundingBox { /* private fields */ }
Expand description

An oriented bounding box in 3D space. Wrapper around C++ implementation maliput::math::BoundingBox.

The box is defined by a position (centroid), box_size (full extents along each axis), and an orientation expressed as roll-pitch-yaw angles.

Implementations§

Source§

impl BoundingBox

Source

pub fn new( position: &Vector3, box_size: &Vector3, orientation: &RollPitchYaw, tolerance: f64, ) -> BoundingBox

Create a new BoundingBox.

§Arguments
  • position — Center of the box in the Inertial frame.
  • box_size — Full extents of the box along each axis (length, width, height).
  • orientation — Orientation of the box in the Inertial frame.
  • tolerance — Tolerance used for containment/intersection queries.
Source

pub fn position(&self) -> Vector3

Returns the position (centroid) of the bounding box in the Inertial frame.

Source

pub fn box_size(&self) -> Vector3

Returns the full extents of the bounding box along each axis.

Source

pub fn orientation(&self) -> RollPitchYaw

Returns the orientation of the bounding box as roll-pitch-yaw angles.

Source

pub fn get_vertices(&self) -> Vec<Vector3>

Returns the 8 vertices of the bounding box in the Inertial frame.

Source

pub fn is_box_contained(&self, other: &BoundingBox) -> bool

Returns true when this bounding box fully contains other.

Source

pub fn is_box_intersected(&self, other: &BoundingBox) -> bool

Returns true when this bounding box intersects other.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.