Physics.P2#createLockConstraint()

createLockConstraint(bodyA, bodyB, offset, angle, maxForce) → {Phaser.Physics.P2.LockConstraint}

Locks the relative position between two bodies.

Parameters
Name Type Argument Default Description
bodyA Phaser.Sprite | Phaser.Physics.P2.Body | p2.Body

First connected body.

bodyB Phaser.Sprite | Phaser.Physics.P2.Body | p2.Body

Second connected body.

offset Array <optional>

The offset of bodyB in bodyA's frame. The value is an array with 2 elements matching x and y, i.e: [32, 32].

angle number <optional>
0

The angle of bodyB in bodyA's frame.

maxForce number <optional>

The maximum force that should be applied to constrain the bodies.

Returns
Source code: physics/p2/World.js (Line 1062)
doc_phaser
2017-02-14 11:00:58
Comments
Leave a Comment

Please login to continue.