Struct liquidfun::box2d::dynamics::world::World
[−]
[src]
pub struct World { pub ptr: *mut B2World, }
The world class manages all physics entities, dynamic simulation, and asynchronous queries. The world also contains efficient memory management facilities.
Fields
ptr |
Methods
impl World
fn new(gravity: &Vec2) -> World
Construct a world object. @param gravity the world gravity vector.
fn create_body(&mut self, def: &BodyDef) -> Body
Create a rigid body given a definition. No reference to the definition is retained. @warning This function is locked during callbacks.
fn create_revolute_joint(&mut self, def: &(JointDef, RevoluteJointDef)) -> RevoluteJoint
Create a revolute joint to constrain bodies together. No reference to the definition is retained. This may cause the connected bodies to cease colliding. @warning This function is locked during callbacks.
fn create_particle_system(&self, def: &ParticleSystemDef) -> ParticleSystem
Create a particle system given a definition. No reference to the definition is retained. @warning This function is locked during callbacks.
fn get_body_count(&self) -> i32
Get the number of bodies.
fn get_joint_count(&self) -> i32
Get the number of joints.
fn get_body_list(&self) -> Option<Body>
Get the world body list. With the returned body, use b2Body::GetNext to get the next body in the world list. A NULL body indicates the end of the list. @return the head of the world body list.
fn get_particle_system_list(&self) -> Option<ParticleSystem>
Get the world particle-system list. With the returned body, use b2ParticleSystem::GetNext to get the next particle-system in the world list. A NULL particle-system indicates the end of the list. @return the head of the world particle-system list.
fn get_gravity(&mut self) -> Vec2
Get the global gravity vector.
fn step(&mut self, time_step: f32, velocity_iterations: i32, position_iterations: i32)
Take a time step. This performs collision detection, integration, and constraint solution. @param timeStep the amount of time to simulate, this should not vary. @param velocityIterations for the velocity constraint solver. @param positionIterations for the position constraint solver.
impl World
fn get_body_iterator(&mut self) -> BodyIterator
Get a world body iterator.