Struct rhusics_core::Material [−][src]
pub struct Material { /* fields omitted */ }
Physics material
Used to describe physical properties of rigid bodies, such as density and restitution.
The default material has density 1, such that only the volume affects its mass, and restitution 1, such that all energy is preserved in collisions.
Methods
impl Material
[src]
impl Material
pub const ROCK: Material
ROCK: Material = Material{density: 0.6, restitution: 0.1,}
Rock
pub const WOOD: Material
WOOD: Material = Material{density: 0.3, restitution: 0.2,}
Wood
pub const METAL: Material
METAL: Material = Material{density: 1.2, restitution: 0.05,}
Metal
pub const BOUNCY_BALL: Material
BOUNCY_BALL: Material = Material{density: 0.3, restitution: 0.8,}
Bouncy Ball
pub const SUPER_BALL: Material
SUPER_BALL: Material = Material{density: 0.3, restitution: 0.95,}
Super Ball
pub const PILLOW: Material
PILLOW: Material = Material{density: 0.1, restitution: 0.2,}
Pillow
pub const STATIC: Material
STATIC: Material = Material{density: 0.0, restitution: 0.4,}
Static
pub fn new(density: f32, restitution: f32) -> Self
[src]
pub fn new(density: f32, restitution: f32) -> Self
Create new material
pub fn density<S>(&self) -> S where
S: BaseFloat,
[src]
pub fn density<S>(&self) -> S where
S: BaseFloat,
Get density
pub fn restitution<S>(&self) -> S where
S: BaseFloat,
[src]
pub fn restitution<S>(&self) -> S where
S: BaseFloat,
Get restitution
Trait Implementations
impl Debug for Material
[src]
impl Debug for Material
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Material
[src]
impl Default for Material