Class: RotationalSpring

Phaser.Physics.P2. 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:

Members

data

Properties:
Name Type Description
data p2.RotationalSpring

The actual p2 spring object.

Source:

game

Properties:
Name Type Description
game Phaser.Game

Local reference to game.

Source:

world

Properties:
Name Type Description
world Phaser.Physics.P2

Local reference to P2 World.

Source:
Phaser Copyright © 2012-2014 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Wed Oct 22 2014 21:46:03 GMT+0100 (BST) using the DocStrap template.