[−][src]Struct physics2d::Body
Fields
id: BodyId
transform: Transform
velocity: Vec2
angular_vel: f32
mass: f32
inertia: f32
inv_mass: f32
inv_inertia: f32
shape: Shape
bounds: Bounds
material: Material
Methods
impl Body
[src]
pub fn new(shape: Shape, density: f32, material: Material) -> Body
[src]
pub fn set_static(&mut self)
[src]
pub fn is_static(&self) -> bool
[src]
pub fn add_force(&mut self, force: Vec2)
[src]
pub fn add_torque(&mut self, torque: f32)
[src]
pub fn add_force_at_pos(&mut self, force: Vec2, pos: Vec2)
[src]
pub fn add_impulse_at_pos(&mut self, impulse: Vec2, pos: Vec2)
[src]
Auto Trait Implementations
impl Sync for Body
impl Send for Body
impl Unpin for Body
impl RefUnwindSafe for Body
impl UnwindSafe for Body
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,