pub struct MetaBody<U: UserDataTypes> { /* private fields */ }

Implementations§

source§

impl<U: UserDataTypes> MetaBody<U>

source

pub fn create_fixture( &mut self, shape: &dyn Shape, def: &mut FixtureDef ) -> FixtureHandle
where U::FixtureData: Default,

source

pub fn create_fixture_with( &mut self, shape: &dyn Shape, def: &mut FixtureDef, data: U::FixtureData ) -> FixtureHandle

source

pub fn create_fast_fixture( &mut self, shape: &dyn Shape, density: f32 ) -> FixtureHandle
where U::FixtureData: Default,

source

pub fn create_fast_fixture_with( &mut self, shape: &dyn Shape, density: f32, data: U::FixtureData ) -> FixtureHandle

source

pub fn fixture(&self, handle: FixtureHandle) -> Ref<'_, MetaFixture<U>>

source

pub fn fixture_mut(&self, handle: FixtureHandle) -> RefMut<'_, MetaFixture<U>>

source

pub fn try_fixture( &self, handle: FixtureHandle ) -> Option<Ref<'_, MetaFixture<U>>>

source

pub fn try_fixture_mut( &self, handle: FixtureHandle ) -> Option<RefMut<'_, MetaFixture<U>>>

source

pub fn destroy_fixture(&mut self, handle: FixtureHandle)

source

pub fn fixtures(&self) -> HandleIter<'_, Fixture, MetaFixture<U>>

source

pub fn contacts(&self) -> ContactIter<'_>

This method is here because contacts are owned by the world and not by the body, and having a reference to a MetaBody requires having a reference to the world.

source

pub unsafe fn contacts_mut(&mut self) -> ContactIterMut<'_>

This method is here because contacts are owned by the world and not by the body, however having a mutable reference to a MetaBody only requires having an immutable reference to the World, that’s why this method is unsafe.

Methods from Deref<Target = Body>§

source

pub fn handle(&self) -> BodyHandle

source

pub fn transform<'a>(&'a self) -> &'a Transform

source

pub fn position<'a>(&'a self) -> &'a Vec2

source

pub fn angle(&self) -> f32

source

pub fn world_center<'a>(&'a self) -> &'a Vec2

source

pub fn local_center<'a>(&'a self) -> &'a Vec2

source

pub fn linear_velocity<'a>(&'a self) -> &'a Vec2

source

pub fn angular_velocity(&self) -> f32

source

pub fn mass(&self) -> f32

source

pub fn inertia(&self) -> f32

source

pub fn mass_data(&self) -> MassData

source

pub fn world_point(&self, local: &Vec2) -> Vec2

source

pub fn world_vector(&self, local: &Vec2) -> Vec2

source

pub fn local_point(&self, world: &Vec2) -> Vec2

source

pub fn local_vector(&self, world: &Vec2) -> Vec2

source

pub fn linear_velocity_from_world_point(&self, world: &Vec2) -> Vec2

source

pub fn linear_velocity_from_local_point(&self, local: &Vec2) -> Vec2

source

pub fn linear_damping(&self) -> f32

source

pub fn angular_damping(&self) -> f32

source

pub fn gravity_scale(&self) -> f32

source

pub fn body_type(&self) -> BodyType

source

pub fn is_bullet(&self) -> bool

source

pub fn is_sleeping_allowed(&self) -> bool

source

pub fn is_awake(&self) -> bool

source

pub fn is_active(&self) -> bool

source

pub fn is_rotation_fixed(&self) -> bool

source

pub fn joints(&self) -> JointIter<'_>

source

pub fn set_transform(&mut self, pos: &Vec2, angle: f32)

source

pub fn set_linear_velocity(&mut self, v: &Vec2)

source

pub fn set_angular_velocity(&mut self, v: f32)

source

pub fn apply_force(&mut self, force: &Vec2, point: &Vec2, wake: bool)

source

pub fn apply_force_to_center(&mut self, force: &Vec2, wake: bool)

source

pub fn apply_torque(&mut self, torque: f32, wake: bool)

source

pub fn apply_linear_impulse(&mut self, impulse: &Vec2, point: &Vec2, wake: bool)

source

pub fn apply_angular_impulse(&mut self, impulse: f32, wake: bool)

source

pub fn set_mass_data(&mut self, data: &MassData)

source

pub fn reset_mass_data(&mut self)

source

pub fn set_linear_damping(&mut self, damping: f32)

source

pub fn set_angular_damping(&mut self, damping: f32)

source

pub fn set_gravity_scale(&mut self, scale: f32)

source

pub fn set_body_type(&mut self, typ: BodyType)

source

pub fn set_bullet(&mut self, flag: bool)

source

pub fn set_sleeping_allowed(&mut self, flag: bool)

source

pub fn set_awake(&mut self, flag: bool)

source

pub fn set_active(&mut self, flag: bool)

source

pub fn set_rotation_fixed(&mut self, flag: bool)

source

pub fn dump(&mut self)

Trait Implementations§

source§

impl<U: UserDataTypes> Deref for MetaBody<U>

§

type Target = Body

The resulting type after dereferencing.
source§

fn deref(&self) -> &Body

Dereferences the value.
source§

impl<U: UserDataTypes> DerefMut for MetaBody<U>

source§

fn deref_mut(&mut self) -> &mut Body

Mutably dereferences the value.
source§

impl<U: UserDataTypes> UserData<<U as UserDataTypes>::BodyData> for MetaBody<U>

source§

fn user_data(&self) -> &U::BodyData

source§

fn user_data_mut(&mut self) -> &mut U::BodyData

source§

fn set_user_data(&mut self, v: U)

Auto Trait Implementations§

§

impl<U> !RefUnwindSafe for MetaBody<U>

§

impl<U> !Send for MetaBody<U>

§

impl<U> !Sync for MetaBody<U>

§

impl<U> Unpin for MetaBody<U>

§

impl<U> UnwindSafe for MetaBody<U>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.