pub struct SweptCapsule {
pub position_start: [f64; 3],
pub position_end: [f64; 3],
pub radius: f64,
pub half_height: f64,
}Expand description
A capsule swept along a straight line defined by start and end positions.
The capsule itself is axis-aligned along the Y axis with given radius
and half_height. The swept volume is the Minkowski sum of the capsule
with the line segment.
Fields§
§position_start: [f64; 3]World-space position of the capsule center at start.
position_end: [f64; 3]World-space position of the capsule center at end.
radius: f64Capsule radius.
half_height: f64Capsule half-height (distance from centre to each hemisphere centre).
Implementations§
Source§impl SweptCapsule
impl SweptCapsule
Sourcepub fn new(
position_start: [f64; 3],
position_end: [f64; 3],
radius: f64,
half_height: f64,
) -> Self
pub fn new( position_start: [f64; 3], position_end: [f64; 3], radius: f64, half_height: f64, ) -> Self
Create a new SweptCapsule.
Sourcepub fn position_at(&self, t: f64) -> [f64; 3]
pub fn position_at(&self, t: f64) -> [f64; 3]
Position at parametric time t.
Sourcepub fn capsule_volume(&self) -> f64
pub fn capsule_volume(&self) -> f64
Volume of the capsule (static, not swept).
Trait Implementations§
Source§impl Clone for SweptCapsule
impl Clone for SweptCapsule
Source§fn clone(&self) -> SweptCapsule
fn clone(&self) -> SweptCapsule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SweptCapsule
impl RefUnwindSafe for SweptCapsule
impl Send for SweptCapsule
impl Sync for SweptCapsule
impl Unpin for SweptCapsule
impl UnsafeUnpin for SweptCapsule
impl UnwindSafe for SweptCapsule
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,
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.