Struct wrapped2d::dynamics::world::World

source ·
pub struct World<U: UserDataTypes> { /* private fields */ }

Implementations§

source§

impl<U: UserDataTypes> World<U>

source

pub fn new(gravity: &Vec2) -> Self

source

pub fn set_contact_filter<F: ContactFilter<U>>(&mut self, filter: Box<F>)

source

pub fn set_contact_listener<L: ContactListener<U>>(&mut self, listener: Box<L>)

source

pub fn create_body(&mut self, def: &BodyDef) -> BodyHandle
where U::BodyData: Default,

source

pub fn create_body_with( &mut self, def: &BodyDef, data: U::BodyData ) -> BodyHandle

source

pub fn body(&self, handle: BodyHandle) -> Ref<'_, MetaBody<U>>

source

pub fn body_mut(&self, handle: BodyHandle) -> RefMut<'_, MetaBody<U>>

source

pub fn try_body(&self, handle: BodyHandle) -> Option<Ref<'_, MetaBody<U>>>

source

pub fn try_body_mut( &self, handle: BodyHandle ) -> Option<RefMut<'_, MetaBody<U>>>

source

pub fn destroy_body(&mut self, handle: BodyHandle)

source

pub fn bodies(&self) -> HandleIter<'_, Body, MetaBody<U>>

source

pub fn create_joint<JD: JointDef>(&mut self, def: &JD) -> JointHandle
where U::JointData: Default,

source

pub fn create_joint_with<JD: JointDef>( &mut self, def: &JD, data: U::JointData ) -> JointHandle

source

pub fn try_create_joint<JD: JointDef>( &mut self, def: &JD ) -> Option<JointHandle>
where U::JointData: Default,

source

pub fn try_create_joint_with<JD: JointDef>( &mut self, def: &JD, data: U::JointData ) -> Option<JointHandle>

source

pub fn joint(&self, handle: JointHandle) -> Ref<'_, MetaJoint<U>>

source

pub fn joint_mut(&self, handle: JointHandle) -> RefMut<'_, MetaJoint<U>>

source

pub fn try_joint(&self, handle: JointHandle) -> Option<Ref<'_, MetaJoint<U>>>

source

pub fn try_joint_mut( &self, handle: JointHandle ) -> Option<RefMut<'_, MetaJoint<U>>>

source

pub fn destroy_joint(&mut self, handle: JointHandle)

source

pub fn joints(&self) -> HandleIter<'_, dyn Joint, MetaJoint<U>>

source

pub fn step( &mut self, time_step: f32, velocity_iterations: i32, position_iterations: i32 )

source

pub fn clear_forces(&mut self)

source

pub fn draw_debug_data<D: Draw>(&mut self, draw: &mut D, flags: DrawFlags)

source

pub fn query_aabb<C: QueryCallback>(&self, callback: &mut C, aabb: &AABB)

source

pub fn ray_cast<C: RayCastCallback>( &self, callback: &mut C, p1: &Vec2, p2: &Vec2 )

source

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

source

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

source

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

source

pub fn is_sleeping_allowed(&self) -> bool

source

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

source

pub fn is_warm_starting(&self) -> bool

source

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

source

pub fn is_continuous_physics(&self) -> bool

source

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

source

pub fn is_sub_stepping(&self) -> bool

source

pub fn proxy_count(&self) -> i32

source

pub fn body_count(&self) -> i32

source

pub fn joint_count(&self) -> i32

source

pub fn contact_count(&self) -> i32

source

pub fn tree_height(&self) -> i32

source

pub fn tree_balance(&self) -> i32

source

pub fn tree_quality(&self) -> f32

source

pub fn set_gravity(&mut self, gravity: &Vec2)

source

pub fn gravity(&self) -> Vec2

source

pub fn is_locked(&self) -> bool

source

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

source

pub fn is_auto_clearing_forces(&self) -> bool

source

pub fn shift_origin(&mut self, origin: &Vec2)

source

pub fn profile<'a>(&'a self) -> &'a Profile

source

pub fn dump(&mut self)

Trait Implementations§

source§

impl<U: UserDataTypes> Drop for World<U>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<U> !RefUnwindSafe for World<U>

§

impl<U> !Send for World<U>

§

impl<U> !Sync for World<U>

§

impl<U> !Unpin for World<U>

§

impl<U> !UnwindSafe for World<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.