pub trait Material: Class<PxMaterial> + UserData {
Show 16 methods
// Provided methods
unsafe fn from_raw(
ptr: *mut PxMaterial,
user_data: Self::UserData
) -> Option<Owner<Self>> { ... }
fn get_user_data(&self) -> &Self::UserData { ... }
fn get_user_data_mut(&mut self) -> &mut Self::UserData { ... }
fn set_dynamic_friction(&mut self, coefficient: f32) { ... }
fn get_dynamic_friction(&self) -> f32 { ... }
fn set_static_friction(&mut self, coefficient: f32) { ... }
fn get_static_friction(&self) -> f32 { ... }
fn set_restitution(&mut self, restitution: f32) { ... }
fn get_restitution(&self) -> f32 { ... }
fn set_flag(&mut self, flag: MaterialFlag, set: bool) { ... }
fn set_flags(&mut self, flags: MaterialFlags) { ... }
fn get_flags(&self) -> MaterialFlags { ... }
fn set_friction_combined_mode(&mut self, combine_mode: CombineMode) { ... }
fn get_friction_combine_mode(&self) -> CombineMode { ... }
fn set_restitution_combine_mode(&mut self, combine_mode: CombineMode) { ... }
fn get_restitution_combine_mode(&self) -> CombineMode { ... }
}
Provided Methods§
sourceunsafe fn from_raw(
ptr: *mut PxMaterial,
user_data: Self::UserData
) -> Option<Owner<Self>>
unsafe fn from_raw( ptr: *mut PxMaterial, user_data: Self::UserData ) -> Option<Owner<Self>>
Safety
Owner’s own the pointer they wrap, using the pointer after dropping the Owner,
or creating multiple Owners from the same pointer will cause UB. Use into_ptr
to
retrieve the pointer and consume the Owner without dropping the pointee.
sourcefn get_user_data(&self) -> &Self::UserData
fn get_user_data(&self) -> &Self::UserData
Get a reference to the user data.
sourcefn get_user_data_mut(&mut self) -> &mut Self::UserData
fn get_user_data_mut(&mut self) -> &mut Self::UserData
Get a mutable reference to the user data.
sourcefn set_dynamic_friction(&mut self, coefficient: f32)
fn set_dynamic_friction(&mut self, coefficient: f32)
Set the dynamic friction.
- Friction must be positive.
- If greater than static friction, effective static friction will be increased to match.
- Will not wake actors.
sourcefn get_dynamic_friction(&self) -> f32
fn get_dynamic_friction(&self) -> f32
Get the dynamic friction.
sourcefn set_static_friction(&mut self, coefficient: f32)
fn set_static_friction(&mut self, coefficient: f32)
Set the static friction.
- Friction must be positive, negative friction is set to 0.0.
- Will not wake actors.
sourcefn get_static_friction(&self) -> f32
fn get_static_friction(&self) -> f32
Get the static frction.
sourcefn set_restitution(&mut self, restitution: f32)
fn set_restitution(&mut self, restitution: f32)
Set the restitution.
- Restitution must be in [0.0 ..= 1.0], values outside tyhe range are clamped.
- A reitution of 0.0 minimizes bouncing, higher values mean more bounce.
sourcefn get_restitution(&self) -> f32
fn get_restitution(&self) -> f32
Get the restitution.
sourcefn set_flag(&mut self, flag: MaterialFlag, set: bool)
fn set_flag(&mut self, flag: MaterialFlag, set: bool)
Set a material flag.
sourcefn set_flags(&mut self, flags: MaterialFlags)
fn set_flags(&mut self, flags: MaterialFlags)
Set all the material flags.
sourcefn get_flags(&self) -> MaterialFlags
fn get_flags(&self) -> MaterialFlags
Get the material flags.
sourcefn set_friction_combined_mode(&mut self, combine_mode: CombineMode)
fn set_friction_combined_mode(&mut self, combine_mode: CombineMode)
Set the friction combine mode.
sourcefn get_friction_combine_mode(&self) -> CombineMode
fn get_friction_combine_mode(&self) -> CombineMode
Get the friction combine mode.
sourcefn set_restitution_combine_mode(&mut self, combine_mode: CombineMode)
fn set_restitution_combine_mode(&mut self, combine_mode: CombineMode)
Set the restitution combine mode.
sourcefn get_restitution_combine_mode(&self) -> CombineMode
fn get_restitution_combine_mode(&self) -> CombineMode
Get the restitution combine mode.