Struct rhusics::physics::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]
const ROCK: Material
ROCK: Material = Material{density: 0.6, restitution: 0.1,}
Rock
const WOOD: Material
WOOD: Material = Material{density: 0.3, restitution: 0.2,}
Wood
const METAL: Material
METAL: Material = Material{density: 1.2, restitution: 0.05,}
Metal
const BOUNCY_BALL: Material
BOUNCY_BALL: Material = Material{density: 0.3, restitution: 0.8,}
Bouncy Ball
const SUPER_BALL: Material
SUPER_BALL: Material = Material{density: 0.3, restitution: 0.95,}
Super Ball
const PILLOW: Material
PILLOW: Material = Material{density: 0.1, restitution: 0.2,}
Pillow
const STATIC: Material
STATIC: Material = Material{density: 0.0, restitution: 0.4,}
Static
fn new(density: f32, restitution: f32) -> Self
[src]
Create new material
fn density<S>(&self) -> S where
S: BaseFloat,
[src]
S: BaseFloat,
Get density
fn restitution<S>(&self) -> S where
S: BaseFloat,
[src]
S: BaseFloat,
Get restitution