# [−][src]Struct nphysics2d::material::BasicMaterial

Description of the state of surface of a solid.

Strictly speaking, the coefficient provided here only exist when considering a pair of touching surfaces. In practice, nphysics will average the coefficient of the two surfaces in contact in order to deduce the restitution/friction coefficient.

## Fields

`id: Option<u32>`

The ID of this material for automatic lookup.

`restitution: N`

Restitution coefficient of the surface.

`friction: N`

Friction coefficient of the surface.

`surface_velocity: Option<Vector<N>>`

The fictitious velocity at the surface of this material.

`restitution_combine_mode: MaterialCombineMode`

The way restitution coefficients are combined if no match was found in the material lookup tables.

`friction_combine_mode: MaterialCombineMode`

The way friction coefficients are combined if no match was found in the material lookup tables.

## Methods

`impl<N: RealField> BasicMaterial<N>`

[src]

`pub fn new(restitution: N, friction: N) -> Self`

[src]

Initialize a material with the specified restitution and friction coefficients.

## Trait Implementations

`impl<N: RealField> Material<N> for BasicMaterial<N>`

[src]

`fn local_properties(`

&self,

context: MaterialContext<N>

) -> LocalMaterialProperties<N>

[src]

&self,

context: MaterialContext<N>

) -> LocalMaterialProperties<N>

`impl<N: Clone + RealField> Clone for BasicMaterial<N>`

[src]

`fn clone(&self) -> BasicMaterial<N>`

[src]

`fn clone_from(&mut self, source: &Self)`

1.0.0[src]

Performs copy-assignment from `source`

. Read more

`impl<N: RealField> Default for BasicMaterial<N>`

[src]

`impl<N: Copy + RealField> Copy for BasicMaterial<N>`

[src]

`impl<N: Debug + RealField> Debug for BasicMaterial<N>`

[src]

## Auto Trait Implementations

`impl<N> Send for BasicMaterial<N> where`

N: Scalar,

N: Scalar,

`impl<N> Unpin for BasicMaterial<N> where`

N: Scalar + Unpin,

N: Scalar + Unpin,

`impl<N> Sync for BasicMaterial<N> where`

N: Scalar,

N: Scalar,

`impl<N> RefUnwindSafe for BasicMaterial<N> where`

N: RefUnwindSafe + Scalar,

N: RefUnwindSafe + Scalar,

`impl<N> UnwindSafe for BasicMaterial<N> where`

N: Scalar + UnwindSafe,

N: Scalar + UnwindSafe,

## Blanket Implementations

`impl<T> From<T> for T`

[src]

`impl<T, U> Into<U> for T where`

U: From<T>,

[src]

U: From<T>,

`impl<T> ToOwned for T where`

T: Clone,

[src]

T: Clone,

`type Owned = T`

The resulting type after obtaining ownership.

`fn to_owned(&self) -> T`

[src]

`fn clone_into(&self, target: &mut T)`

[src]

`impl<T, U> TryFrom<U> for T where`

U: Into<T>,

[src]

U: Into<T>,

`type Error = Infallible`

The type returned in the event of a conversion error.

`fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`

[src]

`impl<T, U> TryInto<U> for T where`

U: TryFrom<T>,

[src]

U: TryFrom<T>,

`type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.

`fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`

[src]

`impl<T> BorrowMut<T> for T where`

T: ?Sized,

[src]

T: ?Sized,

`fn borrow_mut(&mut self) -> &mut T`

[src]

`impl<T> Borrow<T> for T where`

T: ?Sized,

[src]

T: ?Sized,

`impl<T> Any for T where`

T: 'static + ?Sized,

[src]

T: 'static + ?Sized,

`impl<T> Downcast for T where`

T: Any,

T: Any,

`fn into_any(self: Box<T>) -> Box<dyn Any + 'static>`

`fn as_any(&self) -> &(dyn Any + 'static)`

`fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)`

`impl<T> Same<T> for T`

`type Output = T`

Should always be `Self`

`impl<SS, SP> SupersetOf<SS> for SP where`

SS: SubsetOf<SP>,

SS: SubsetOf<SP>,

`fn to_subset(&self) -> Option<SS>`

`fn is_in_subset(&self) -> bool`

`unsafe fn to_subset_unchecked(&self) -> SS`

`fn from_subset(element: &SS) -> SP`

`impl<T> Slottable for T where`

T: Copy,

[src]

T: Copy,