Trait physx::material::Material

source ·
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§

source

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.

source

fn get_user_data(&self) -> &Self::UserData

Get a reference to the user data.

source

fn get_user_data_mut(&mut self) -> &mut Self::UserData

Get a mutable reference to the user data.

source

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.
source

fn get_dynamic_friction(&self) -> f32

Get the dynamic friction.

source

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.
source

fn get_static_friction(&self) -> f32

Get the static frction.

source

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.
source

fn get_restitution(&self) -> f32

Get the restitution.

source

fn set_flag(&mut self, flag: MaterialFlag, set: bool)

Set a material flag.

source

fn set_flags(&mut self, flags: MaterialFlags)

Set all the material flags.

source

fn get_flags(&self) -> MaterialFlags

Get the material flags.

source

fn set_friction_combined_mode(&mut self, combine_mode: CombineMode)

Set the friction combine mode.

source

fn get_friction_combine_mode(&self) -> CombineMode

Get the friction combine mode.

source

fn set_restitution_combine_mode(&mut self, combine_mode: CombineMode)

Set the restitution combine mode.

source

fn get_restitution_combine_mode(&self) -> CombineMode

Get the restitution combine mode.

Implementors§