[][src]Trait nphysics2d::material::Material

pub trait Material<N: RealField>: Downcast + Send + Sync + MaterialClone<N> {
    fn local_properties(
        &self,
        context: MaterialContext<N>
    ) -> LocalMaterialProperties<N>; }

An abstract material.

Required methods

fn local_properties(
    &self,
    context: MaterialContext<N>
) -> LocalMaterialProperties<N>

Retrieve the local material properties of a collider at the given contact point.

Loading content...

Methods

impl<N> dyn Material<N> where
    N: Any + 'static,
    N: RealField, 

pub fn is<__T: Material<N>>(&self) -> bool

Returns true if the trait object wraps an object of type __T.

pub fn downcast<__T: Material<N>>(
    self: Box<Self>
) -> Result<Box<__T>, Box<Self>>

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn't.

pub fn downcast_rc<__T: Material<N>>(
    self: Rc<Self>
) -> Result<Rc<__T>, Rc<Self>>

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn't.

pub fn downcast_ref<__T: Material<N>>(&self) -> Option<&__T>

Returns a reference to the object within the trait object if it is of type __T, or None if it isn't.

pub fn downcast_mut<__T: Material<N>>(&mut self) -> Option<&mut __T>

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn't.

impl<N: RealField> dyn Material<N>[src]

pub fn combine<M1: ?Sized, M2: ?Sized>(
    table: &MaterialsCoefficientsTable<N>,
    material1: &M1,
    context1: MaterialContext<N>,
    material2: &M2,
    context2: MaterialContext<N>
) -> LocalMaterialProperties<N> where
    M1: Material<N>,
    M2: Material<N>, 
[src]

Combine two materials given their contexts and a material lookup table.

Trait Implementations

impl<N: RealField> AsRef<dyn Material<N> + 'static> for MaterialHandle<N>[src]

Implementors

impl<N: RealField> Material<N> for BasicMaterial<N>[src]

Loading content...