pub struct OrientedBoundingBox3 {
pub center: Point3,
pub orientation: UnitQuat,
/* private fields */
}Expand description
An oriented bounding box.
Fields§
§center: Point3The center of the OBB.
orientation: UnitQuatThe rotation of the OBB.
Implementations§
Source§impl OrientedBoundingBox3
impl OrientedBoundingBox3
Sourcepub fn new(center: Point3, orientation: UnitQuat, extents: Vec3) -> Self
pub fn new(center: Point3, orientation: UnitQuat, extents: Vec3) -> Self
Create a new OBB from the given center, orientation, and extents.
Sourcepub fn extents(&self) -> Vec3
pub fn extents(&self) -> Vec3
Extents of the OBB along the x, y, and z axes. Always half of size.
Sourcepub fn axis_aligned_bounding_box(&self) -> Aabb3
pub fn axis_aligned_bounding_box(&self) -> Aabb3
Calculate the axis aligned bounding box of the OBB
Trait Implementations§
Source§impl Clone for OrientedBoundingBox3
impl Clone for OrientedBoundingBox3
impl Copy for OrientedBoundingBox3
Source§impl Debug for OrientedBoundingBox3
impl Debug for OrientedBoundingBox3
Source§impl PartialEq for OrientedBoundingBox3
impl PartialEq for OrientedBoundingBox3
impl StructuralPartialEq for OrientedBoundingBox3
Auto Trait Implementations§
impl Freeze for OrientedBoundingBox3
impl RefUnwindSafe for OrientedBoundingBox3
impl Send for OrientedBoundingBox3
impl Sync for OrientedBoundingBox3
impl Unpin for OrientedBoundingBox3
impl UnsafeUnpin for OrientedBoundingBox3
impl UnwindSafe for OrientedBoundingBox3
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.