These archived docs are for Phaser 2.4.3 Phaser 3 docs can be found on
Phaser CE docs can be found on the Phaser CE Documentation site.


Phaser.Physics.P2. GearConstraint

new GearConstraint(world, bodyA, bodyB, angle, ratio)

Connects two bodies at given offset points, letting them rotate relative to each other around this point.

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.

angle number <optional>

The relative angle

ratio number <optional>

The gear ratio.

Source code: physics/p2/GearConstraint.js (Line 18)

Public Properties

game : Phaser.Game

Local reference to game.

Source code: physics/p2/GearConstraint.js (Line 26)

world : Phaser.Physics.P2

Local reference to P2 World.

Source code: physics/p2/GearConstraint.js (Line 31)