diff --git a/src/gameobjects/mesh/Mesh.js b/src/gameobjects/mesh/Mesh.js index bd090b01d..480c5efbb 100644 --- a/src/gameobjects/mesh/Mesh.js +++ b/src/gameobjects/mesh/Mesh.js @@ -364,6 +364,7 @@ var Mesh = new Class({ */ this.fov; + // Set these to allow setInteractive to work this.displayOriginX = 0; this.displayOriginY = 0; @@ -1163,55 +1164,26 @@ var Mesh = new Class({ * @return {this} This GameObject. */ setInteractive: function () - { - this.scene.sys.input.enable(this, this.hitAreaCallback.bind(this)); - - return this; - }, - - /** - * The internal hit area callback for this Mesh. - * - * @method Phaser.GameObjects.Mesh#hitAreaCallback - * @since 3.60.0 - * - * @return {this} This GameObject. - */ - hitAreaCallback: function (area, x, y) { var faces = this.faces; - for (var i = 0; i < faces.length; i++) + var hitAreaCallback = function (area, x, y) { - var face = faces[i]; - - // Don't pass a calcMatrix, as the x/y are already transformed - if (face.contains(x, y)) + for (var i = 0; i < faces.length; i++) { - return true; + var face = faces[i]; + + // Don't pass a calcMatrix, as the x/y are already transformed + if (face.contains(x, y)) + { + return true; + } } - } - return false; - }, + return false; + }; - /** - * If this Mesh Game Object has previously been enabled for input, this will disable it. - * - * An object that is disabled for input stops processing or being considered for - * input events, but can be turned back on again at any time by simply calling - * `setInteractive()` with no arguments provided. - * - * If want to completely remove interaction from this Game Object then use `removeInteractive` instead. - * - * @method Phaser.GameObjects.Mesh#disableInteractive - * @since 3.60.0 - * - * @return {this} This GameObject. - */ - disableInteractive: function () - { - this.scene.sys.input.disable(this); + this.scene.sys.input.enable(this, hitAreaCallback); return this; }, diff --git a/src/gameobjects/plane/Plane.js b/src/gameobjects/plane/Plane.js index 03acf28e0..a656c1b6c 100644 --- a/src/gameobjects/plane/Plane.js +++ b/src/gameobjects/plane/Plane.js @@ -36,10 +36,6 @@ var UUID = require('../../utils/string/UUID'); * The Plane Game Object also has the Animation component, allowing you to play animations * across the Plane just as you would with a Sprite. * - * While a Plane cannot be enabled for input it does have the methods `hasFaceAt` and - * `getFaceAt` which can be used with Pointer coordinates to detect if they have clicked - * on Plane face, or not. - * * Note that the Plane object is WebGL only and does not have a Canvas counterpart. * * The Plane origin is always 0.5 x 0.5 and cannot be changed.