pub struct PhysicsMaterial {
pub id: MaterialId,
pub static_friction: Fix128,
pub dynamic_friction: Fix128,
pub restitution: Fix128,
pub friction_combine: CombineRule,
pub restitution_combine: CombineRule,
}Expand description
Physics material definition
Fields§
§id: MaterialIdMaterial identifier
static_friction: Fix128Static friction coefficient
dynamic_friction: Fix128Dynamic friction coefficient
restitution: Fix128Restitution (bounciness)
friction_combine: CombineRuleFriction combine rule
restitution_combine: CombineRuleRestitution combine rule
Implementations§
Source§impl PhysicsMaterial
impl PhysicsMaterial
Sourcepub const fn new(id: MaterialId, friction: Fix128, restitution: Fix128) -> Self
pub const fn new(id: MaterialId, friction: Fix128, restitution: Fix128) -> Self
Create a new material with given properties
Sourcepub const fn with_combine_rules(
self,
friction: CombineRule,
restitution: CombineRule,
) -> Self
pub const fn with_combine_rules( self, friction: CombineRule, restitution: CombineRule, ) -> Self
Set combine rules
Sourcepub const fn with_static_friction(self, static_friction: Fix128) -> Self
pub const fn with_static_friction(self, static_friction: Fix128) -> Self
Set separate static/dynamic friction
Trait Implementations§
Source§impl Clone for PhysicsMaterial
impl Clone for PhysicsMaterial
impl Copy for PhysicsMaterial
Source§impl Debug for PhysicsMaterial
impl Debug for PhysicsMaterial
Source§impl Default for PhysicsMaterial
impl Default for PhysicsMaterial
impl Eq for PhysicsMaterial
Source§impl PartialEq for PhysicsMaterial
impl PartialEq for PhysicsMaterial
impl StructuralPartialEq for PhysicsMaterial
Auto Trait Implementations§
impl Freeze for PhysicsMaterial
impl RefUnwindSafe for PhysicsMaterial
impl Send for PhysicsMaterial
impl Sync for PhysicsMaterial
impl Unpin for PhysicsMaterial
impl UnsafeUnpin for PhysicsMaterial
impl UnwindSafe for PhysicsMaterial
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<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> ⓘ
Converts
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> ⓘ
Converts
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 more