Physics.P2#createGearConstraint()

createGearConstraint(bodyA, bodyB, angle, ratio) → {Phaser.Physics.P2.GearConstraint}

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

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.

angle number <optional>
0

The relative angle

ratio number <optional>
1

The gear ratio.

Returns
Source code: physics/p2/World.js (Line 1007)
doc_phaser
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.