PivotJoint
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 Members
@private
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.
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.
Anchor point on first Body.
This anchor point is defined in the local coordinate system of body1.
Anchor point on second Body.
This anchor point is defined in the local coordinate system of body2.
@inheritDoc
For this constraint, the MatMN will be 2x1.
Returns |
---|
nape.geom.MatMN |
@inheritDoc
Name | Type |
---|---|
body |
nape.phys.Body |
Returns |
---|
nape.geom.Vec3 |
@inheritDoc
Name | Type |
---|---|
lambda |
Function |
new(body1: Null<nape.phys.Body>, body2: Null<nape.phys.Body>, anchor1: nape.geom.Vec2, anchor2: nape.geom.Vec2): Void
Construct a new PivotJoint.
Name | Type | Description |
---|---|---|
body1 |
Null<nape.phys.Body> | The first body in PivotJoint. |
body2 |
Null<nape.phys.Body> | The second body in PivotJoint. |
anchor1 |
nape.geom.Vec2 | The first local anchor for joint. |
anchor2 |
nape.geom.Vec2 | The second local anchor for joint. |
Private Members
Metadata
Name | Parameters |
---|---|
:final |
- |