pub struct Aabb {
pub centre: [f64; 3],
pub size: [f64; 3],
}Expand description
A box with its edges along the scene’s axes: an obstacle, or a part of the machine that can hit one
(Machine::collision_bodies). Metres, in scene coordinates.
Fields§
§centre: [f64; 3]§size: [f64; 3]Implementations§
Source§impl Aabb
impl Aabb
Sourcepub fn gap(&self, other: &Aabb) -> ([f64; 3], [f64; 3], f64)
pub fn gap(&self, other: &Aabb) -> ([f64; 3], [f64; 3], f64)
The nearest points of the two boxes, one on each, and the clearance between them: the distance of the two points; where the boxes overlap, the depth of the overlap, negative: how far one box would have to move to part from the other, along the axis where that is least (both points then lie in the middle of the overlap). A box inside the other along an axis has to leave by the nearer face; the intersection’s width (the depth until 14 November) is the depth only where neither box holds the other, and was 0 for a point inside a box.
Trait Implementations§
impl Copy for Aabb
Source§impl<'de> Deserialize<'de> for Aabb
impl<'de> Deserialize<'de> for Aabb
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Aabb
Auto Trait Implementations§
impl Freeze for Aabb
impl RefUnwindSafe for Aabb
impl Send for Aabb
impl Sync for Aabb
impl Unpin for Aabb
impl UnsafeUnpin for Aabb
impl UnwindSafe for Aabb
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