pub struct World { /* private fields */ }Implementations§
Source§impl World
impl World
pub fn spawn(&mut self, desc: BodyDesc) -> BodyHandle
pub fn remove(&mut self, handle: BodyHandle)
pub fn read_state(&self, handle: BodyHandle) -> BodyState
pub fn set_position(&mut self, handle: BodyHandle, position: [f32; 3])
pub fn set_orientation(&mut self, handle: BodyHandle, orientation: [f32; 4])
pub fn set_velocity(&mut self, handle: BodyHandle, velocity: [f32; 3])
pub fn set_angular_velocity( &mut self, handle: BodyHandle, angular_velocity: [f32; 3], )
pub fn set_mass(&mut self, handle: BodyHandle, mass: f32)
pub fn set_density(&mut self, handle: BodyHandle, density: f32)
pub fn set_com(&mut self, handle: BodyHandle, com: [f32; 3])
pub fn set_inertia(&mut self, handle: BodyHandle, inertia: [f32; 6])
pub fn set_linear_damping(&mut self, handle: BodyHandle, damping: f32)
pub fn set_angular_damping(&mut self, handle: BodyHandle, damping: f32)
pub fn set_gravity_scale(&mut self, handle: BodyHandle, gravity_scale: f32)
pub fn set_sleep_thresholds( &mut self, handle: BodyHandle, velocity: f32, angular_velocity: f32, )
pub fn set_collision_group(&mut self, handle: BodyHandle, group: u32)
pub fn set_collision_mask(&mut self, handle: BodyHandle, mask: u32)
pub fn set_ccd(&mut self, handle: BodyHandle, ccd: bool)
pub fn set_kinematic(&mut self, handle: BodyHandle, kinematic: bool)
pub fn set_collider( &mut self, handle: BodyHandle, index: usize, collider: ColliderDesc, )
pub fn add_collider(&mut self, handle: BodyHandle, collider: ColliderDesc)
pub fn remove_collider(&mut self, handle: BodyHandle, index: usize)
pub fn set_shape(&mut self, handle: BodyHandle, shape: Shape)
pub fn set_restitution(&mut self, handle: BodyHandle, restitution: f32)
pub fn set_friction(&mut self, handle: BodyHandle, friction: f32)
pub fn set_collider_events( &mut self, handle: BodyHandle, index: usize, events: ContactEventMode, )
pub fn apply_force(&mut self, handle: BodyHandle, force: [f32; 3])
pub fn apply_force_at_point( &mut self, handle: BodyHandle, force: [f32; 3], point: [f32; 3], )
pub fn apply_torque(&mut self, handle: BodyHandle, torque: [f32; 3])
pub fn apply_impulse(&mut self, handle: BodyHandle, impulse: [f32; 3])
pub fn apply_impulse_at_point( &mut self, handle: BodyHandle, impulse: [f32; 3], point: [f32; 3], )
pub fn apply_angular_impulse(&mut self, handle: BodyHandle, impulse: [f32; 3])
pub fn wake(&mut self, handle: BodyHandle)
pub fn sleep(&mut self, handle: BodyHandle)
Source§impl World
impl World
pub fn add_constraint( &mut self, first: BodyHandle, second: BodyHandle, desc: ConstraintDesc, ) -> ConstraintHandle
pub fn update_constraint( &mut self, handle: ConstraintHandle, desc: ConstraintDesc, )
pub fn set_motor( &mut self, handle: ConstraintHandle, target_velocity: f32, max_force: f32, )
pub fn set_limit( &mut self, handle: ConstraintHandle, limit: Option<ConstraintLimit>, )
pub fn set_spring( &mut self, handle: ConstraintHandle, spring: Option<ConstraintSpring>, )
pub fn set_break_threshold( &mut self, handle: ConstraintHandle, threshold: Option<ConstraintBreak>, )
pub fn set_warm_start(&mut self, handle: ConstraintHandle, warm_start: bool)
pub fn set_servo( &mut self, handle: ConstraintHandle, target_position: f32, stiffness: f32, damping: f32, )
pub fn set_swing_limits( &mut self, handle: ConstraintHandle, swing: Option<ConstraintSwing>, )
pub fn set_constraint_disable_collisions( &mut self, handle: ConstraintHandle, disable: bool, )
pub fn remove_constraint(&mut self, handle: ConstraintHandle)
pub fn constraints(&self) -> &[ConstraintHandle]
Source§impl World
impl World
pub fn drain_events(&mut self) -> Vec<ContactEvent>
pub fn set_event_sink(&mut self, sink: Option<Box<dyn FnMut(ContactEvent)>>)
Source§impl World
impl World
pub fn ray_query( &mut self, origin: [f32; 3], direction: [f32; 3], max_t: f32, filter: &QueryFilter, ) -> QueryHandle
pub fn sphere_query( &mut self, center: [f32; 3], radius: f32, filter: &QueryFilter, ) -> QueryHandle
pub fn cuboid_query( &mut self, center: [f32; 3], half_extents: [f32; 3], filter: &QueryFilter, ) -> QueryHandle
pub fn point_query( &mut self, origin: [f32; 3], filter: &QueryFilter, ) -> QueryHandle
pub fn overlap_query( &mut self, shape: &Shape, orientation: [f32; 4], position: [f32; 3], filter: &QueryFilter, ) -> QueryHandle
pub fn sweep_query( &mut self, shape: &Shape, orientation: [f32; 4], start: [f32; 3], direction: [f32; 3], length: f32, filter: &QueryFilter, ) -> QueryHandle
pub fn query_hit(&self, handle: QueryHandle) -> Option<QueryHit>
pub fn query_hits(&self, handle: QueryHandle) -> &[QueryHit]
pub fn query_overflow(&self, handle: QueryHandle) -> bool
pub fn flush_queries(&mut self)
Source§impl World
impl World
pub fn poll(&mut self)
pub fn wait(&mut self)
pub fn synchronize_states(&mut self)
pub fn measured(&self) -> &Counters
pub fn contact_manifolds(&mut self) -> Vec<ContactManifold>
pub fn drain_constraint_breaks(&mut self) -> Vec<ConstraintHandle>
Source§impl World
impl World
pub fn add_hull( &mut self, vertices: &[[f32; 3]], triangles: &[[u32; 3]], ) -> ShapeSourceHandle
pub fn add_mesh( &mut self, vertices: &[[f32; 3]], triangles: &[[u32; 3]], ) -> ShapeSourceHandle
pub fn add_decomposed_mesh( &mut self, vertices: &[[f32; 3]], triangles: &[[u32; 3]], settings: HullDecomposeSettings, ) -> Vec<ShapeSourceHandle>
pub fn add_hull_from_mesh( &mut self, vertices: &[[f32; 3]], triangles: &[[u32; 3]], ) -> ShapeSourceHandle
pub fn add_height_field( &mut self, rows: u32, cols: u32, heights: &[f32], cell_size: [f32; 2], ) -> ShapeSourceHandle
pub fn remove_shape(&mut self, handle: ShapeSourceHandle)
pub fn update_mesh( &mut self, handle: ShapeSourceHandle, vertices: &[[f32; 3]], triangles: &[[u32; 3]], )
pub fn update_height_field( &mut self, handle: ShapeSourceHandle, rows: u32, cols: u32, heights: &[f32], cell_size: [f32; 2], )
Source§impl World
impl World
pub fn new(gpu: GpuContext, config: PhysicsConfig) -> Self
pub fn config(&self) -> &PhysicsConfig
pub fn set_config(&mut self, config: PhysicsConfig)
pub fn set_gravity(&mut self, gravity: [f32; 3])
pub fn stream_capacity(&self) -> StreamCapacity
pub fn bodies(&self) -> &[BodyHandle]
pub fn count(&self) -> usize
pub fn state_buffer(&self) -> &GpuBuffer
pub fn collider_buffer(&self) -> &GpuBuffer
pub fn gpu(&self) -> &GpuContext
pub fn warmup(&self, budget: WarmupBudget) -> WarmupProgress
pub fn is_warm(&self) -> bool
Auto Trait Implementations§
impl !Freeze for World
impl !RefUnwindSafe for World
impl !Send for World
impl !Sync for World
impl !UnwindSafe for World
impl Unpin for World
impl UnsafeUnpin for World
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