pub struct MetaBody<U: UserDataTypes> { /* private fields */ }
Implementations§
source§impl<U: UserDataTypes> MetaBody<U>
impl<U: UserDataTypes> MetaBody<U>
pub fn create_fixture(
&mut self,
shape: &dyn Shape,
def: &mut FixtureDef
) -> FixtureHandlewhere
U::FixtureData: Default,
pub fn create_fixture_with( &mut self, shape: &dyn Shape, def: &mut FixtureDef, data: U::FixtureData ) -> FixtureHandle
pub fn create_fast_fixture(
&mut self,
shape: &dyn Shape,
density: f32
) -> FixtureHandlewhere
U::FixtureData: Default,
pub fn create_fast_fixture_with( &mut self, shape: &dyn Shape, density: f32, data: U::FixtureData ) -> FixtureHandle
pub fn fixture(&self, handle: FixtureHandle) -> Ref<'_, MetaFixture<U>>
pub fn fixture_mut(&self, handle: FixtureHandle) -> RefMut<'_, MetaFixture<U>>
pub fn try_fixture( &self, handle: FixtureHandle ) -> Option<Ref<'_, MetaFixture<U>>>
pub fn try_fixture_mut( &self, handle: FixtureHandle ) -> Option<RefMut<'_, MetaFixture<U>>>
pub fn destroy_fixture(&mut self, handle: FixtureHandle)
pub fn fixtures(&self) -> HandleIter<'_, Fixture, MetaFixture<U>>
sourcepub fn contacts(&self) -> ContactIter<'_> ⓘ
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.
sourcepub unsafe fn contacts_mut(&mut self) -> ContactIterMut<'_> ⓘ
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>§
pub fn handle(&self) -> BodyHandle
pub fn transform<'a>(&'a self) -> &'a Transform
pub fn position<'a>(&'a self) -> &'a Vec2
pub fn angle(&self) -> f32
pub fn world_center<'a>(&'a self) -> &'a Vec2
pub fn local_center<'a>(&'a self) -> &'a Vec2
pub fn linear_velocity<'a>(&'a self) -> &'a Vec2
pub fn angular_velocity(&self) -> f32
pub fn mass(&self) -> f32
pub fn inertia(&self) -> f32
pub fn mass_data(&self) -> MassData
pub fn world_point(&self, local: &Vec2) -> Vec2
pub fn world_vector(&self, local: &Vec2) -> Vec2
pub fn local_point(&self, world: &Vec2) -> Vec2
pub fn local_vector(&self, world: &Vec2) -> Vec2
pub fn linear_velocity_from_world_point(&self, world: &Vec2) -> Vec2
pub fn linear_velocity_from_local_point(&self, local: &Vec2) -> Vec2
pub fn linear_damping(&self) -> f32
pub fn angular_damping(&self) -> f32
pub fn gravity_scale(&self) -> f32
pub fn body_type(&self) -> BodyType
pub fn is_bullet(&self) -> bool
pub fn is_sleeping_allowed(&self) -> bool
pub fn is_awake(&self) -> bool
pub fn is_active(&self) -> bool
pub fn is_rotation_fixed(&self) -> bool
pub fn joints(&self) -> JointIter<'_> ⓘ
pub fn set_transform(&mut self, pos: &Vec2, angle: f32)
pub fn set_linear_velocity(&mut self, v: &Vec2)
pub fn set_angular_velocity(&mut self, v: f32)
pub fn apply_force(&mut self, force: &Vec2, point: &Vec2, wake: bool)
pub fn apply_force_to_center(&mut self, force: &Vec2, wake: bool)
pub fn apply_torque(&mut self, torque: f32, wake: bool)
pub fn apply_linear_impulse(&mut self, impulse: &Vec2, point: &Vec2, wake: bool)
pub fn apply_angular_impulse(&mut self, impulse: f32, wake: bool)
pub fn set_mass_data(&mut self, data: &MassData)
pub fn reset_mass_data(&mut self)
pub fn set_linear_damping(&mut self, damping: f32)
pub fn set_angular_damping(&mut self, damping: f32)
pub fn set_gravity_scale(&mut self, scale: f32)
pub fn set_body_type(&mut self, typ: BodyType)
pub fn set_bullet(&mut self, flag: bool)
pub fn set_sleeping_allowed(&mut self, flag: bool)
pub fn set_awake(&mut self, flag: bool)
pub fn set_active(&mut self, flag: bool)
pub fn set_rotation_fixed(&mut self, flag: bool)
pub fn dump(&mut self)
Trait Implementations§
source§impl<U: UserDataTypes> Deref for MetaBody<U>
impl<U: UserDataTypes> Deref for MetaBody<U>
source§impl<U: UserDataTypes> DerefMut for MetaBody<U>
impl<U: UserDataTypes> DerefMut for MetaBody<U>
source§impl<U: UserDataTypes> UserData<<U as UserDataTypes>::BodyData> for MetaBody<U>
impl<U: UserDataTypes> UserData<<U as UserDataTypes>::BodyData> for MetaBody<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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more