Struct nphysics2d::detection::joint::Anchor
[−]
[src]
pub struct Anchor<N: Real, P> { pub body: Option<Rc<RefCell<RigidBody<N>>>>, pub position: P, }
One of the two end points of a joint.
Fields
body: Option<Rc<RefCell<RigidBody<N>>>>
The body attached to this anchor.
position: P
The attach position, in local coordinates of the attached body.
Methods
impl<N: Real, P> Anchor<N, P>[src]
fn new(body: Option<Rc<RefCell<RigidBody<N>>>>, position: P) -> Anchor<N, P>
Creates a new Anchor at a given position on a body local space.
If body is None, the anchor is concidered to be attached to the ground and position
is the attach point in global coordinates.
impl<N: Real, P> Anchor<N, P>[src]
fn center_of_mass(&self) -> Point<N>
The center of mass of the body attached to this anchor.
Returns the zero vector if no body is attached.