mirror of
https://github.com/wassname/phaser.git
synced 2026-07-08 00:10:32 +08:00
Updated physics body to use localTransform. Updated tanks demo.
This commit is contained in:
@@ -1286,8 +1286,8 @@ Phaser.Physics.Arcade.prototype = {
|
||||
|
||||
pointer = pointer || this.game.input.activePointer;
|
||||
|
||||
this._dx = displayObject.x - pointer.x;
|
||||
this._dy = displayObject.y - pointer.y;
|
||||
this._dx = displayObject.worldX - pointer.x;
|
||||
this._dy = displayObject.worldY - pointer.y;
|
||||
|
||||
return Math.sqrt(this._dx * this._dx + this._dy * this._dy);
|
||||
|
||||
@@ -1340,8 +1340,8 @@ Phaser.Physics.Arcade.prototype = {
|
||||
|
||||
pointer = pointer || this.game.input.activePointer;
|
||||
|
||||
this._dx = pointer.x - displayObject.x;
|
||||
this._dy = pointer.y - displayObject.y;
|
||||
this._dx = pointer.worldX - displayObject.x;
|
||||
this._dy = pointer.worldY - displayObject.y;
|
||||
|
||||
return Math.atan2(this._dy, this._dx);
|
||||
|
||||
|
||||
@@ -105,8 +105,8 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
|
||||
this.embedded = false;
|
||||
|
||||
this.preX = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
|
||||
this.preY = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
|
||||
this.preX = (this.sprite.localTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
|
||||
this.preY = (this.sprite.localTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
|
||||
this.preRotation = this.sprite.angle;
|
||||
|
||||
this.x = this.preX;
|
||||
@@ -221,12 +221,12 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
this.angularVelocity = 0;
|
||||
this.angularAcceleration = 0;
|
||||
|
||||
this.preX = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
|
||||
this.preY = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
|
||||
this.preX = (this.sprite.localTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
|
||||
this.preY = (this.sprite.localTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
|
||||
this.preRotation = this.sprite.angle;
|
||||
|
||||
this.x = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
|
||||
this.y = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
|
||||
this.x = (this.sprite.localTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
|
||||
this.y = (this.sprite.localTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
|
||||
this.rotation = this.sprite.angle;
|
||||
|
||||
},
|
||||
|
||||
@@ -539,8 +539,6 @@ Phaser.Utils.Debug.prototype = {
|
||||
this.line('scaleY: ' + sprite.localTransform[4]);
|
||||
this.line('transX: ' + sprite.localTransform[2]);
|
||||
this.line('transY: ' + sprite.localTransform[5]);
|
||||
this.line('sX: ' + sprite._sx);
|
||||
this.line('sY: ' + sprite._sy);
|
||||
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user