diff --git a/v3/src/components/BaseTransform.js b/v3/src/components/BaseTransform.js index 480f7d9a9..6e5120050 100644 --- a/v3/src/components/BaseTransform.js +++ b/v3/src/components/BaseTransform.js @@ -4,6 +4,10 @@ * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ +var MATH_CONST = require('../math/const'); +var WrapAngle = require('../math/angle/Wrap'); +var Transform = require('./Transform'); + /** * A BaseTransform class that you can use when extending Game Objects. * Hides away the 'private' stuff and exposes only the useful getters and setters @@ -12,7 +16,7 @@ */ var BaseTransform = function (x, y) { - this.transform = new Phaser.Component.Transform(this, x, y); + this.transform = new Transform(this, x, y); }; BaseTransform.prototype.constructor = BaseTransform; @@ -199,12 +203,12 @@ Object.defineProperties(BaseTransform.prototype, { get: function () { - return Phaser.Math.wrapAngle(this.rotation * Phaser.Math.RAD_TO_DEG); + return WrapAngle(this.rotation * MATH_CONST.RAD_TO_DEG); }, set: function (value) { - this.rotation = Phaser.Math.wrapAngle(value) * Phaser.Math.DEG_TO_RAD; + this.rotation = WrapAngle(value) * MATH_CONST.DEG_TO_RAD; } }, @@ -228,7 +232,7 @@ Object.defineProperties(BaseTransform.prototype, { this.transform._rotation = value; this.transform.dirty = true; - if (this.transform._rotation % Phaser.Math.PI2) + if (this.transform._rotation % MATH_CONST.PI2) { this.transform.cache.sr = Math.sin(this.transform._rotation); this.transform.cache.cr = Math.cos(this.transform._rotation);