pub struct RigidBodyCcd {
pub ccd_thickness: f32,
pub ccd_active: bool,
pub ccd_enabled: bool,
pub soft_ccd_prediction: f32,
pub allow_fast_rotation: bool,
}Expand description
Information used for Continuous-Collision-Detection.
Fields§
§ccd_thickness: f32The distance used by the CCD solver to decide if a movement would result in a tunnelling problem.
ccd_active: boolIs CCD active for this rigid-body?
Set automatically for any dynamic body moving fast enough to tunnel (regardless of
self.ccd_enabled): it then sweeps fixed colliders, or all bodies if ccd_enabled is set too.
ccd_enabled: boolIs full (“bullet”) CCD enabled for this rigid-body?
Fast dynamic bodies always sweep fixed colliders; true upgrades this body to also
sweep kinematic and dynamic bodies.
soft_ccd_prediction: f32The soft-CCD prediction distance for this rigid-body.
allow_fast_rotation: boolAllow this body to exceed the angular speed cap.
By default angular velocity is clamped each substep to ~45°/step to keep CCD reliable;
set true for bodies that must spin fast (e.g. wheels).
Implementations§
Source§impl RigidBodyCcd
impl RigidBodyCcd
Sourcepub const FAST_BODY_SAFETY_FACTOR: f32 = 0.5
pub const FAST_BODY_SAFETY_FACTOR: f32 = 0.5
The fast-body safety factor: a body is fast when it can move more than half its thinnest extent in one step.
Sourcepub fn max_point_velocity(
&self,
vels: &RigidBodyVelocity<f32>,
max_extent: f32,
) -> f32
pub fn max_point_velocity( &self, vels: &RigidBodyVelocity<f32>, max_extent: f32, ) -> f32
The maximum velocity any point of any collider attached to this rigid-body moving with the given velocity can have.
max_extent is the body’s farthest collider point distance from its center of
mass (RigidBodyMassProps::max_extent).
Sourcepub fn is_moving_fast(
&self,
dt: f32,
vels: &RigidBodyVelocity<f32>,
forces: Option<&RigidBodyForces>,
max_extent: f32,
) -> bool
pub fn is_moving_fast( &self, dt: f32, vels: &RigidBodyVelocity<f32>, forces: Option<&RigidBodyForces>, max_extent: f32, ) -> bool
Is this rigid-body moving fast enough so that it may cause a tunneling problem?
The fast-body criterion: fast when the farthest point of its colliders can move more
than half the body’s thinnest extent (ccd_thickness) within one timestep.
Sourcepub fn is_moving_fast_with_next_position(
&self,
dt: f32,
vels: &RigidBodyVelocity<f32>,
pos: &RigidBodyPosition,
local_com: Vector,
max_extent: f32,
) -> bool
pub fn is_moving_fast_with_next_position( &self, dt: f32, vels: &RigidBodyVelocity<f32>, pos: &RigidBodyPosition, local_com: Vector, max_extent: f32, ) -> bool
The fast-body criterion evaluated on the actual solved motion of this step.
pos must hold the solved next_position; the test uses the larger of the actual pose
delta and the velocity-based estimate.
Trait Implementations§
Source§impl Clone for RigidBodyCcd
impl Clone for RigidBodyCcd
Source§fn clone(&self) -> RigidBodyCcd
fn clone(&self) -> RigidBodyCcd
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RigidBodyCcd
Source§impl Debug for RigidBodyCcd
impl Debug for RigidBodyCcd
Source§impl Default for RigidBodyCcd
impl Default for RigidBodyCcd
Source§impl PartialEq for RigidBodyCcd
impl PartialEq for RigidBodyCcd
Source§fn eq(&self, other: &RigidBodyCcd) -> bool
fn eq(&self, other: &RigidBodyCcd) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RigidBodyCcd
Auto Trait Implementations§
impl Freeze for RigidBodyCcd
impl RefUnwindSafe for RigidBodyCcd
impl Send for RigidBodyCcd
impl Sync for RigidBodyCcd
impl Unpin for RigidBodyCcd
impl UnsafeUnpin for RigidBodyCcd
impl UnwindSafe for RigidBodyCcd
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSync for T
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.