Struct heron::rapier_plugin::rapier2d::dynamics::RigidBodyActivation
pub struct RigidBodyActivation {
pub linear_threshold: f32,
pub angular_threshold: f32,
pub time_since_can_sleep: f32,
pub sleeping: bool,
}
Expand description
The rb_activation status of a body.
This controls whether a body is sleeping or not. If the threshold is negative, the body never sleeps.
Fields
linear_threshold: f32
The threshold linear velocity bellow which the body can fall asleep.
angular_threshold: f32
The angular linear velocity bellow which the body can fall asleep.
time_since_can_sleep: f32
Since how much time can this body sleep?
sleeping: bool
Is this body sleeping?
Implementations
impl RigidBodyActivation
impl RigidBodyActivation
pub fn default_linear_threshold() -> f32
pub fn default_linear_threshold() -> f32
The default linear velocity bellow which a body can be put to sleep.
pub fn default_angular_threshold() -> f32
pub fn default_angular_threshold() -> f32
The default angular velocity bellow which a body can be put to sleep.
pub fn default_time_until_sleep() -> f32
pub fn default_time_until_sleep() -> f32
The amount of time the rigid-body must remain bellow it’s linear and angular velocity threshold before falling to sleep.
pub fn active() -> RigidBodyActivation
pub fn active() -> RigidBodyActivation
Create a new rb_activation status initialised with the default rb_activation threshold and is active.
pub fn inactive() -> RigidBodyActivation
pub fn inactive() -> RigidBodyActivation
Create a new rb_activation status initialised with the default rb_activation threshold and is inactive.
pub fn cannot_sleep() -> RigidBodyActivation
pub fn cannot_sleep() -> RigidBodyActivation
Create a new activation status that prevents the rigid-body from sleeping.
pub fn sleep(&mut self)
pub fn sleep(&mut self)
Put this rigid-body to sleep.
Trait Implementations
impl Clone for RigidBodyActivation
impl Clone for RigidBodyActivation
fn clone(&self) -> RigidBodyActivation
fn clone(&self) -> RigidBodyActivation
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreimpl Debug for RigidBodyActivation
impl Debug for RigidBodyActivation
impl Default for RigidBodyActivation
impl Default for RigidBodyActivation
fn default() -> RigidBodyActivation
fn default() -> RigidBodyActivation
impl PartialEq<RigidBodyActivation> for RigidBodyActivation
impl PartialEq<RigidBodyActivation> for RigidBodyActivation
fn eq(&self, other: &RigidBodyActivation) -> bool
fn eq(&self, other: &RigidBodyActivation) -> bool
impl Copy for RigidBodyActivation
impl StructuralPartialEq for RigidBodyActivation
Auto Trait Implementations
impl RefUnwindSafe for RigidBodyActivation
impl Send for RigidBodyActivation
impl Sync for RigidBodyActivation
impl Unpin for RigidBodyActivation
impl UnwindSafe for RigidBodyActivation
Blanket Implementations
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
fn as_bind_group_shader_type(
&self,
_images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset, RandomState, Global>
) -> U
fn as_bind_group_shader_type(
&self,
_images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset, RandomState, Global>
) -> U
T
[ShaderType
] for self
. When used in [AsBindGroup
]
derives, it is safe to assume that all images in self
exist. Read moresourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read morefn 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. Read morefn 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. Read moreimpl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given [World]sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read morefn 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).fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.