Phaser.Physics.P2. RevoluteConstraint

new RevoluteConstraint(world, bodyA, pivotA, bodyB, pivotB, maxForce, worldPivot)

Connects two bodies at given offset points, letting them rotate relative to each other around this point. The pivot points are given in world (pixel) coordinates.

Parameters:
Name Type Argument Default Description
world Phaser.Physics.P2

A reference to the P2 World.

bodyA p2.Body

First connected body.

pivotA Float32Array

The point relative to the center of mass of bodyA which bodyA is constrained to. The value is an array with 2 elements matching x and y, i.e: [32, 32].

bodyB p2.Body

Second connected body.

pivotB Float32Array

The point relative to the center of mass of bodyB which bodyB is constrained to. The value is an array with 2 elements matching x and y, i.e: [32, 32].

maxForce number <optional>
0

The maximum force that should be applied to constrain the bodies.

worldPivot Float32Array <optional>
null

A pivot point given in world coordinates. If specified, localPivotA and localPivotB are automatically computed from this value.

Source - physics/p2/RevoluteConstraint.js, line 21

Members

game :Phaser.Game

Local reference to game.

Source - physics/p2/RevoluteConstraint.js, line 29

world :Phaser.Physics.P2

Local reference to P2 World.

Source - physics/p2/RevoluteConstraint.js, line 34
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网
如有问题,记得强刷一下.

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