class nape.constraint.PivotJoint extends Constraint

Available on all platforms

PivotJoint constraining two anchors points of bodies to be equal. *

* The equation for this constraint is: *

 * body2.localPointToWorld(anchor2) = body1.localPointToWorld(anchor1)
 * 
* You may view this constraint as being equal to the DistanceJoint constraint * when both its jointMin and jointMax are exactly 0 (In such a case a * DistanceJoint becomes degenerate). Compared to the DistanceJoint this is * a 2 dimensional constraint.

Instance Fields

var anchor1:Vec2

Anchor point on first Body. *

* This anchor point is defined in the local coordinate system of body1.

var anchor2:Vec2

Anchor point on second Body. *

* This anchor point is defined in the local coordinate system of body2.

var body1:Null<Body>

First Body in constraint. *

* This value may be null, but trying to simulate the constraint whilst * this body is null will result in an error.

var body2:Null<Body>

Second Body in constraint. *

* This value may be null, but trying to simulate the constraint whilst * this body is null will result in an error.

function new(body1:Null<Body>, body2:Null<Body>, anchor1:Vec2, anchor2:Vec2):Void

Construct a new PivotJoint. * *

body1

The first body in PivotJoint. *

body2

The second body in PivotJoint. *

anchor1

The first local anchor for joint. *

anchor2

The second local anchor for joint. *

returns

The constructed PivotJoint.

function bodyImpulse(body:Body):Vec3

@inheritDoc

function impulse():MatMN

@inheritDoc *

* For this constraint, the MatMN will be 2x1.

function visitBodies(lambda:Body ->Void):Void

@inheritDoc