Class: DistanceConstraint

Phaser.Physics.P2. DistanceConstraint

new DistanceConstraint(world, bodyA, bodyB, distance [, localAnchorA] [, localAnchorB] [, maxForce])

A constraint that tries to keep the distance between two bodies constant.

Parameters:
Name Type Argument Default Description
world Phaser.Physics.P2

A reference to the P2 World.

bodyA p2.Body

First connected body.

bodyB p2.Body

Second connected body.

distance number

The distance to keep between the bodies.

localAnchorA Array <optional>

The anchor point for bodyA, defined locally in bodyA frame. Defaults to [0,0].

localAnchorB Array <optional>

The anchor point for bodyB, defined locally in bodyB frame. Defaults to [0,0].

maxForce object <optional>
Number.MAX_VALUE

Maximum force to apply.

Source:
src/physics/p2/DistanceConstraint.js line 20

Members

game : Phaser.Game

Local reference to game.

Type:
Source:
src/physics/p2/DistanceConstraint.js line 31

world : Phaser.Physics.P2

Local reference to P2 World.

Type:
Source:
src/physics/p2/DistanceConstraint.js line 36

phaser-ce@2.20.0 is on GitHub and NPM

Documentation generated by JSDoc 3.6.7 on 2022-12-10 using Tomorrow.