pub trait Material: Class<PxMaterial> + UserData {
Show 18 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 get_reference_count(&self) -> u32 { ... }
fn acquire_reference(&mut self) { ... }
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

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.

Get a reference to the user data.

Get a mutable reference to the user data.

Get the current ref count of the material.

Increment the ref count of the material.

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.

Get the dynamic friction.

Set the static friction.

  • Friction must be positive, negative friction is set to 0.0.
  • Will not wake actors.

Get the static frction.

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.

Get the restitution.

Set a material flag.

Set all the material flags.

Get the material flags.

Set the friction combine mode.

Get the friction combine mode.

Set the restitution combine mode.

Get the restitution combine mode.

Implementors