Class: GearConstraint

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.

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.

angle number <optional>
0

The relative angle

ratio number <optional>
1

The gear ratio.

Source:
src/physics/p2/GearConstraint.js line 18

Members

game : Phaser.Game

Local reference to game.

Type:
Source:
src/physics/p2/GearConstraint.js line 27

world : Phaser.Physics.P2

Local reference to P2 World.

Type:
Source:
src/physics/p2/GearConstraint.js line 32

phaser-ce@2.20.0 is on GitHub and NPM

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