pub struct OrientedBox3D { /* private fields */ }Expand description
Oriented bounding box in 3D space used for tight rotated collider narrow-phase tests.
Implementations§
Source§impl OrientedBox3D
Exact oriented bounding box and 13-axis SAT triangle intersection helpers for OrientedBox3D.
impl OrientedBox3D
Exact oriented bounding box and 13-axis SAT triangle intersection helpers for OrientedBox3D.
Sourcepub fn from_bounds(bounds_rect: AxisAlignedBox3D) -> Self
pub fn from_bounds(bounds_rect: AxisAlignedBox3D) -> Self
Sourcepub fn to_world_bounds(&self) -> AxisAlignedBox3D
pub fn to_world_bounds(&self) -> AxisAlignedBox3D
Sourcepub fn intersect_triangle_world(
&self,
w0: Vec3,
w1: Vec3,
w2: Vec3,
) -> Option<(Vec3, f32, Vec3)>
pub fn intersect_triangle_world( &self, w0: Vec3, w1: Vec3, w2: Vec3, ) -> Option<(Vec3, f32, Vec3)>
Tests exact 13-axis Akenine-Möller SAT intersection between this OrientedBox3D and a world-space triangle (w0, w1, w2).
§Arguments
&Self- Oriented bounding box reference.Vec3- Triangle vertex 0 in world space.Vec3- Triangle vertex 1 in world space.Vec3- Triangle vertex 2 in world space.
§Returns
Option<(Vec3, f32, Vec3)>-(world_outward_normal, penetration_depth, world_contact_point)when intersecting.
Sourcepub fn intersects_oriented_box(&self, other: &Self) -> bool
pub fn intersects_oriented_box(&self, other: &Self) -> bool
Tests exact 15-axis Separating Axis Theorem intersection between two world-space OrientedBox3D volumes for symmetric vehicle-vs-vehicle collision checks.
§Arguments
&Self- First oriented bounding box.&Self- Second oriented bounding box.
§Returns
bool-truewhen the two oriented bounding boxes overlap.
Sourcepub fn intersect_oriented_box_xz(
&self,
other: &Self,
) -> Option<(Vec3, f32, Vec3)>
pub fn intersect_oriented_box_xz( &self, other: &Self, ) -> Option<(Vec3, f32, Vec3)>
Computes an exact horizontal XZ Separating Axis Theorem contact manifold between two world-space OrientedBox3D vehicle volumes.
§Arguments
&Self- Second oriented bounding box (B).
§Returns
Option<(Vec3, f32, Vec3)>-(unit_normal_b_to_a, penetration_m, world_contact_point)when overlapping vertically and horizontally.
Source§impl OrientedBox3D
Implements impl #impl_generics #name #ty_generics #where_clause.
impl OrientedBox3D
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_center(&self) -> Vec3
pub fn get_mut_center(&mut self) -> &mut Vec3
pub fn set_center(&mut self, val: Vec3) -> &mut Self
pub fn get_axes(&self) -> [Vec3; 3]
pub fn get_mut_axes(&mut self) -> &mut [Vec3; 3]
pub fn set_axes(&mut self, val: [Vec3; 3]) -> &mut Self
pub fn get_half_extents(&self) -> Vec3
pub fn get_mut_half_extents(&mut self) -> &mut Vec3
pub fn set_half_extents(&mut self, val: Vec3) -> &mut Self
Trait Implementations§
Source§impl Clone for OrientedBox3D
impl Clone for OrientedBox3D
impl Copy for OrientedBox3D
Source§impl Debug for OrientedBox3D
impl Debug for OrientedBox3D
Source§impl PartialEq for OrientedBox3D
impl PartialEq for OrientedBox3D
impl StructuralPartialEq for OrientedBox3D
Auto Trait Implementations§
impl Forget for OrientedBox3D
impl Freeze for OrientedBox3D
impl Move for OrientedBox3D
impl RefUnwindSafe for OrientedBox3D
impl Send for OrientedBox3D
impl Sync for OrientedBox3D
impl Unpin for OrientedBox3D
impl UnsafeUnpin for OrientedBox3D
impl UnwindSafe for OrientedBox3D
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