Struct liquidfun::box2d::dynamics::body::Body [] [src]

pub struct Body {
    pub ptr: *mut B2Body,
}

A rigid body. These are created via b2World::CreateBody.

Fields

ptr

Methods

impl Body

fn create_fixture(&self, def: &FixtureDef) -> Fixture

Creates a fixture and attach it to this body. Use this function if you need to set some fixture parameters, like friction. Otherwise you can create the fixture directly from a shape. If the density is non-zero, this function automatically updates the mass of the body. Contacts are not created until the next time step. @param def the fixture definition. @warning This function is locked during callbacks.

fn create_fixture_from_shape(&self, shape: &Shape, density: f32) -> Fixture

Creates a fixture from a shape and attach it to this body. This is a convenience function. Use FixtureDef if you need to set parameters like friction, restitution, user data, or filtering. If the density is non-zero, this function automatically updates the mass of the body. @param shape the shape to be cloned. @param density the shape density (set to zero for static bodies). @warning This function is locked during callbacks.

fn get_angle(&self) -> f32

Get the angle in radians. @return the current world rotation angle in radians.

fn get_fixture_list(&self) -> Option<Fixture>

Get the list of all fixtures attached to this body.

fn get_next(&self) -> Option<Body>

Get the next body in the world's body list.

fn get_position(&self) -> &Vec2

Get the world body origin position. @return the world position of the body's origin.

fn get_user_data(&self) -> usize

Get the user data pointer that was provided in the body definition.

fn get_world(&self) -> World

Get the parent world of this body.

fn get_local_point(&self, world_point: &Vec2) -> Vec2

impl Body

fn get_fixture_iterator(&mut self) -> FixtureIterator

Trait Implementations

Derived Implementations

impl Debug for Body

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for Body

fn clone(&self) -> Body

fn clone_from(&mut self, source: &Self)