mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
Setting a P2.Body from Static or Kinematic to Dynamic will now automatically adjust the Body.mass to be 1 (thanks @wayfu #2005)
This commit is contained in:
parent
994a7dae73
commit
55a7699381
2 changed files with 3 additions and 10 deletions
|
@ -282,6 +282,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
|
|||
* VideoStream.active = false is used if the browser supports it, otherwise it falls back to VideoStream.stop.
|
||||
* Text can now accept `undefined` or `null` as the `text` argument in the constructor and will cast it as an empty string.
|
||||
* Point.rotate uses a faster and simpler rotation function when no distance argument is specified.
|
||||
* Setting a P2.Body from Static or Kinematic to Dynamic will now automatically adjust the Body.mass to be 1 (thanks @wayfu #2005)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
|
|
@ -1434,12 +1434,8 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "static", {
|
|||
else if (!value && this.data.type === Phaser.Physics.P2.Body.STATIC)
|
||||
{
|
||||
this.data.type = Phaser.Physics.P2.Body.DYNAMIC;
|
||||
|
||||
if (this.mass === 0)
|
||||
{
|
||||
this.mass = 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1462,12 +1458,8 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "dynamic", {
|
|||
if (value && this.data.type !== Phaser.Physics.P2.Body.DYNAMIC)
|
||||
{
|
||||
this.data.type = Phaser.Physics.P2.Body.DYNAMIC;
|
||||
|
||||
if (this.mass === 0)
|
||||
{
|
||||
this.mass = 1;
|
||||
}
|
||||
}
|
||||
else if (!value && this.data.type === Phaser.Physics.P2.Body.DYNAMIC)
|
||||
{
|
||||
this.data.type = Phaser.Physics.P2.Body.STATIC;
|
||||
|
|
Loading…
Reference in a new issue