- //if (noPreventDefault) { evt.preventDefault(); } //if pinch gesture, could be usefull to force preventDefault to avoid html page scroll/zoom in some mobile browsers
- pointers.item(evt.pointerId).x = evt.clientX;
- pointers.item(evt.pointerId).y = evt.clientY;
- var direction = _this.pinchInwards ? 1 : -1;
- var distX = pointers.getItemByIndex(0).x - pointers.getItemByIndex(1).x;
- var distY = pointers.getItemByIndex(0).y - pointers.getItemByIndex(1).y;
+ //if (noPreventDefault) { evt.preventDefault(); } //if pinch gesture, could be usefull to force preventDefault to avoid html page scroll/zoom in some mobile browsers
+ pointers.item(evt.pointerId).x = evt.clientX;
+ pointers.item(evt.pointerId).y = evt.clientY;
+ var direction = _this.pinchInwards ? 1 : -1;
+ var distX = pointers.getItemByIndex(0).x - pointers.getItemByIndex(1).x;
+ var distY = pointers.getItemByIndex(0).y - pointers.getItemByIndex(1).y;
- //-- 2016-03-08 properties for backward compatibility for inputs
- //deprecated
- get: function () {
- BABYLON.Tools.Warn("Warning: angularSensibility is deprecated on DeviceOrientationCamera, use camera.inputs.attached.deviceOrientation.angularSensibility instead.");
- var gamepad = this.inputs.attached["deviceOrientation"];
- if (gamepad)
- return gamepad.angularSensibility;
- },
- //deprecated
- set: function (value) {
- BABYLON.Tools.Warn("Warning: angularSensibility is deprecated on DeviceOrientationCamera, use camera.inputs.attached.deviceOrientation.angularSensibility instead.");
- var gamepad = this.inputs.attached["deviceOrientation"];
- BABYLON.Tools.Warn("Warning: moveSensibility is deprecated on DeviceOrientationCamera, use camera.inputs.attached.deviceOrientation.moveSensibility instead.");
- var gamepad = this.inputs.attached["deviceOrientation"];
- if (gamepad)
- return gamepad.moveSensibility;
- },
- //deprecated
- set: function (value) {
- BABYLON.Tools.Warn("Warning: moveSensibility is deprecated on DeviceOrientationCamera, use camera.inputs.attached.deviceOrientation.moveSensibility instead.");
- var gamepad = this.inputs.attached["deviceOrientation"];
- if (gamepad)
- gamepad.moveSensibility = value;
- },
- enumerable: true,
- configurable: true
- });
- DeviceOrientationCamera.prototype.getTypeName = function () {
+ //-- 2016-03-08 properties for backward compatibility for inputs
+ //deprecated
+ get: function () {
+ BABYLON.Tools.Warn("Warning: angularSensibility is deprecated on DeviceOrientationCamera, use camera.inputs.attached.deviceOrientation.angularSensibility instead.");
+ var gamepad = this.inputs.attached["deviceOrientation"];
+ if (gamepad)
+ return gamepad.angularSensibility;
+ },
+ //deprecated
+ set: function (value) {
+ BABYLON.Tools.Warn("Warning: angularSensibility is deprecated on DeviceOrientationCamera, use camera.inputs.attached.deviceOrientation.angularSensibility instead.");
+ var gamepad = this.inputs.attached["deviceOrientation"];
+ BABYLON.Tools.Warn("Warning: moveSensibility is deprecated on DeviceOrientationCamera, use camera.inputs.attached.deviceOrientation.moveSensibility instead.");
+ var gamepad = this.inputs.attached["deviceOrientation"];
+ if (gamepad)
+ return gamepad.moveSensibility;
+ },
+ //deprecated
+ set: function (value) {
+ BABYLON.Tools.Warn("Warning: moveSensibility is deprecated on DeviceOrientationCamera, use camera.inputs.attached.deviceOrientation.moveSensibility instead.");
+ var gamepad = this.inputs.attached["deviceOrientation"];
+ if (gamepad)
+ gamepad.moveSensibility = value;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ DeviceOrientationCamera.prototype.getTypeName = function () {
- //-- 2016-03-08 properties for backward compatibility for inputs
- //deprecated
- get: function () {
- BABYLON.Tools.Warn("Warning: gamepadAngularSensibility is deprecated on GamepadCamera, use camera.inputs.attached.gamepad.gamepadAngularSensibility instead.");
- var gamepad = this.inputs.attached["gamepad"];
- if (gamepad)
- return gamepad.gamepadAngularSensibility;
- },
- //deprecated
- set: function (value) {
- BABYLON.Tools.Warn("Warning: gamepadAngularSensibility is deprecated on GamepadCamera, use camera.inputs.attached.gamepad.gamepadAngularSensibility instead.");
- BABYLON.Tools.Warn("Warning: gamepadMoveSensibility is deprecated on GamepadCamera, use camera.inputs.attached.gamepad.gamepadMoveSensibility instead.");
- var gamepad = this.inputs.attached["gamepad"];
- if (gamepad)
- return gamepad.gamepadMoveSensibility;
- },
- //deprecated
- set: function (value) {
- BABYLON.Tools.Warn("Warning: gamepadMoveSensibility is deprecated on GamepadCamera, use camera.inputs.attached.gamepad.gamepadMoveSensibility instead.");
- var gamepad = this.inputs.attached["gamepad"];
- if (gamepad)
- gamepad.gamepadMoveSensibility = value;
- },
- enumerable: true,
- configurable: true
- });
- GamepadCamera.prototype.getTypeName = function () {
- return "GamepadCamera";
- };
- return GamepadCamera;
- }(BABYLON.UniversalCamera));
- BABYLON.GamepadCamera = GamepadCamera;
-})(BABYLON || (BABYLON = {}));
+var __extends = (this && this.__extends) || function (d, b) {
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var BABYLON;
+(function (BABYLON) {
+ // We're mainly based on the logic defined into the FreeCamera code
+ var GamepadCamera = (function (_super) {
+ __extends(GamepadCamera, _super);
+ //-- end properties for backward compatibility for inputs
+ function GamepadCamera(name, position, scene) {
+ BABYLON.Tools.Warn("Deprecated. Please use Universal Camera instead.");
+ //-- 2016-03-08 properties for backward compatibility for inputs
+ //deprecated
+ get: function () {
+ BABYLON.Tools.Warn("Warning: gamepadAngularSensibility is deprecated on GamepadCamera, use camera.inputs.attached.gamepad.gamepadAngularSensibility instead.");
+ var gamepad = this.inputs.attached["gamepad"];
+ if (gamepad)
+ return gamepad.gamepadAngularSensibility;
+ },
+ //deprecated
+ set: function (value) {
+ BABYLON.Tools.Warn("Warning: gamepadAngularSensibility is deprecated on GamepadCamera, use camera.inputs.attached.gamepad.gamepadAngularSensibility instead.");
+ BABYLON.Tools.Warn("Warning: gamepadMoveSensibility is deprecated on GamepadCamera, use camera.inputs.attached.gamepad.gamepadMoveSensibility instead.");
+ var gamepad = this.inputs.attached["gamepad"];
+ if (gamepad)
+ return gamepad.gamepadMoveSensibility;
+ },
+ //deprecated
+ set: function (value) {
+ BABYLON.Tools.Warn("Warning: gamepadMoveSensibility is deprecated on GamepadCamera, use camera.inputs.attached.gamepad.gamepadMoveSensibility instead.");
+ var gamepad = this.inputs.attached["gamepad"];
+ if (gamepad)
+ gamepad.gamepadMoveSensibility = value;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ GamepadCamera.prototype.getTypeName = function () {
- //-- 2016-03-08 properties for backward compatibility for inputs
- //deprecated
- get: function () {
- BABYLON.Tools.Warn("Warning: touchAngularSensibility is deprecated on TouchCamera, use camera.inputs.attached.touch.touchAngularSensibility instead.");
- var touch = this.inputs.attached["touch"];
- if (touch)
- return touch.touchAngularSensibility;
- },
- //deprecated
- set: function (value) {
- BABYLON.Tools.Warn("Warning: touchAngularSensibility is deprecated on TouchCamera, use camera.inputs.attached.touch.touchAngularSensibility instead.");
+ //-- 2016-03-08 properties for backward compatibility for inputs
+ //deprecated
+ get: function () {
+ BABYLON.Tools.Warn("Warning: touchAngularSensibility is deprecated on TouchCamera, use camera.inputs.attached.touch.touchAngularSensibility instead.");
+ var touch = this.inputs.attached["touch"];
+ if (touch)
+ return touch.touchAngularSensibility;
+ },
+ //deprecated
+ set: function (value) {
+ BABYLON.Tools.Warn("Warning: touchAngularSensibility is deprecated on TouchCamera, use camera.inputs.attached.touch.touchAngularSensibility instead.");
-var __extends = (this && this.__extends) || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var BABYLON;
-(function (BABYLON) {
- /**
- * This represents a texture coming from an HDR input.
- *
- * The only supported format is currently panorama picture stored in RGBE format.
- * Example of such files can be found on HDRLib: http://hdrlib.com/
- */
- var HDRCubeTexture = (function (_super) {
- __extends(HDRCubeTexture, _super);
- /**
- * Instantiates an HDRTexture from the following parameters.
- *
- * @param url The location of the HDR raw data (Panorama stored in RGBE format)
- * @param scene The scene the texture will be used in
- * @param size The cubemap desired size (the more it increases the longer the generation will be)
- * @param noMipmap Forces to not generate the mipmap if true
- * @param generateHarmonics Specifies wether you want to extract the polynomial harmonics during the generation process
- * @param useInGammaSpace Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)
- * @param usePMREMGenerator Specifies wether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time.
- */
- function HDRCubeTexture(url, scene, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator) {
+var __extends = (this && this.__extends) || function (d, b) {
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var BABYLON;
+(function (BABYLON) {
+ /**
+ * This represents a texture coming from an HDR input.
+ *
+ * The only supported format is currently panorama picture stored in RGBE format.
+ * Example of such files can be found on HDRLib: http://hdrlib.com/
+ */
+ var HDRCubeTexture = (function (_super) {
+ __extends(HDRCubeTexture, _super);
+ /**
+ * Instantiates an HDRTexture from the following parameters.
+ *
+ * @param url The location of the HDR raw data (Panorama stored in RGBE format)
+ * @param scene The scene the texture will be used in
+ * @param size The cubemap desired size (the more it increases the longer the generation will be)
+ * @param noMipmap Forces to not generate the mipmap if true
+ * @param generateHarmonics Specifies wether you want to extract the polynomial harmonics during the generation process
+ * @param useInGammaSpace Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)
+ * @param usePMREMGenerator Specifies wether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time.
+ */
+ function HDRCubeTexture(url, scene, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator) {
- Effect.prototype.setFloat3 = function (uniformName, x, y, z) {
- if (this._valueCache[uniformName] && this._valueCache[uniformName][0] === x && this._valueCache[uniformName][1] === y && this._valueCache[uniformName][2] === z)
- return this;
- this._cacheFloat3(uniformName, x, y, z);
- this._engine.setFloat3(this.getUniform(uniformName), x, y, z);
- return this;
- };
- Effect.prototype.setVector4 = function (uniformName, vector4) {
- Effect.prototype.setFloat4 = function (uniformName, x, y, z, w) {
- if (this._valueCache[uniformName] && this._valueCache[uniformName][0] === x && this._valueCache[uniformName][1] === y && this._valueCache[uniformName][2] === z && this._valueCache[uniformName][3] === w)
- return this;
- this._cacheFloat4(uniformName, x, y, z, w);
- this._engine.setFloat4(this.getUniform(uniformName), x, y, z, w);
- return this;
- };
- Effect.prototype.setColor3 = function (uniformName, color3) {
+ Effect.prototype.setFloat3 = function (uniformName, x, y, z) {
+ if (this._valueCache[uniformName] && this._valueCache[uniformName][0] === x && this._valueCache[uniformName][1] === y && this._valueCache[uniformName][2] === z)
+ return this;
+ this._cacheFloat3(uniformName, x, y, z);
+ this._engine.setFloat3(this.getUniform(uniformName), x, y, z);
+ return this;
+ };
+ Effect.prototype.setVector4 = function (uniformName, vector4) {
+ Effect.prototype.setFloat4 = function (uniformName, x, y, z, w) {
+ if (this._valueCache[uniformName] && this._valueCache[uniformName][0] === x && this._valueCache[uniformName][1] === y && this._valueCache[uniformName][2] === z && this._valueCache[uniformName][3] === w)
+ return this;
+ this._cacheFloat4(uniformName, x, y, z, w);
+ this._engine.setFloat4(this.getUniform(uniformName), x, y, z, w);
+ return this;
+ };
+ Effect.prototype.setColor3 = function (uniformName, color3) {