[−][src]Trait oxygengine_physics_2d::prelude::material::Material
An abstract material.
Required methods
fn local_properties(
&self,
context: MaterialContext<N>
) -> LocalMaterialProperties<N>
&self,
context: MaterialContext<N>
) -> LocalMaterialProperties<N>
Retrieve the local material properties of a collider at the given contact point.
Implementations
impl<N> dyn Material<N> + 'static where
N: RealField,
[src]
N: RealField,
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]
table: &MaterialsCoefficientsTable<N>,
material1: &M1,
context1: MaterialContext<N>,
material2: &M2,
context2: MaterialContext<N>
) -> LocalMaterialProperties<N> where
M1: Material<N> + ?Sized,
M2: Material<N> + ?Sized,
Combine two materials given their contexts and a material lookup table.
impl<N> dyn Material<N> + 'static where
N: Any + 'static + RealField,
N: Any + 'static + RealField,
pub fn is<__T>(&self) -> bool where
__T: Material<N>,
__T: Material<N>,
Returns true if the trait object wraps an object of type __T
.
pub fn downcast<__T>(
self: Box<dyn Material<N> + 'static>
) -> Result<Box<__T>, Box<dyn Material<N> + 'static>> where
__T: Material<N>,
self: Box<dyn Material<N> + 'static>
) -> Result<Box<__T>, Box<dyn Material<N> + 'static>> where
__T: Material<N>,
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>,
self: Rc<dyn Material<N> + 'static>
) -> Result<Rc<__T>, Rc<dyn Material<N> + 'static>> where
__T: Material<N>,
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>,
__T: Material<N>,
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>,
__T: Material<N>,
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]
N: RealField,
Implementors
impl<N> Material<N> for BasicMaterial<N> where
N: RealField,
[src]
N: RealField,
fn local_properties(
&self,
context: MaterialContext<N>
) -> LocalMaterialProperties<N>
[src]
&self,
context: MaterialContext<N>
) -> LocalMaterialProperties<N>