Class: RotationalSpring

Phaser.Physics.P2. RotationalSpring

new RotationalSpring(world, bodyA, bodyB [, restAngle] [, stiffness] [, damping])

Creates a rotational spring, connecting two bodies. A spring can have a resting length, a stiffness and damping.

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.

restAngle number <optional>

The relative angle of bodies at which the spring is at rest. If not given, it's set to the current relative angle between the bodies.

stiffness number <optional>
100

Stiffness of the spring. A number >= 0.

damping number <optional>
1

Damping of the spring. A number >= 0.

Source:
src/physics/p2/RotationalSpring.js line 19

Members

data : p2.RotationalSpring

The actual p2 spring object.

Type:
  • p2.RotationalSpring
Source:
src/physics/p2/RotationalSpring.js line 49

game : Phaser.Game

Local reference to game.

Type:
Source:
src/physics/p2/RotationalSpring.js line 24

world : Phaser.Physics.P2

Local reference to P2 World.

Type:
Source:
src/physics/p2/RotationalSpring.js line 29

phaser-ce@2.9.2 is on GitHub and NPM

Documentation generated by JSDoc 3.5.4 on 2017-11-09 using Tomorrow.