Trait oxygengine_physics_2d::prelude::material::Material[][src]

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

An abstract material.

Required methods

pub fn local_properties(
    &self,
    context: MaterialContext<'_, N>
) -> LocalMaterialProperties<N>
[src]

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

Loading content...

Implementations

impl<N> dyn Material<N> + 'static where
    N: RealField
[src]

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

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

impl<N> dyn Material<N> + 'static where
    N: Any + 'static + RealField
[src]

pub fn is<__T>(&self) -> bool where
    __T: Material<N>, 
[src]

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

pub fn downcast<__T>(
    self: Box<dyn Material<N> + 'static, Global>
) -> Result<Box<__T, Global>, Box<dyn Material<N> + 'static, Global>> where
    __T: Material<N>, 
[src]

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>(
    self: Rc<dyn Material<N> + 'static>
) -> Result<Rc<__T>, Rc<dyn Material<N> + 'static>> where
    __T: Material<N>, 
[src]

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>(&self) -> Option<&__T> where
    __T: Material<N>, 
[src]

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>(&mut self) -> Option<&mut __T> where
    __T: Material<N>, 
[src]

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

Trait Implementations

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

Implementors

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

Loading content...