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 - physics/p2/RotationalSpring.js, line 19

Members

data :p2.RotationalSpring

The actual p2 spring object.

Source - physics/p2/RotationalSpring.js, line 49

game :Phaser.Game

Local reference to game.

Source - physics/p2/RotationalSpring.js, line 24

world :Phaser.Physics.P2

Local reference to P2 World.

Source - physics/p2/RotationalSpring.js, line 29
Phaser Copyright © 2012-2015 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.2 on Thu Feb 18 2016 14:41:05 GMT+0000 (GMT Standard Time) using the DocStrap template.

快捷菜单

注意:只有登录才能全文翻译,每个新用户赠送300会员币。
赚取方法:文章评论+1000,分享网站截图给站长+3000,另充10元+100万会员币
支持一下记得截图给站长!

VIP限时免费阅读!登录可得1万币尽情中文阅读!


记得CTRL+D收藏!
站长微信:
支持自学php网
如有问题,记得强刷一下.

  • data :p2.RotationalSpring - 属性
  • game :Phaser.Game - 属性
  • world :Phaser.Physics.P2 - 属性