|
@@ -3943,7 +3943,6 @@ var BABYLON;
|
|
|
convertedColor.b = Math.pow(this.b, BABYLON.ToGammaSpace);
|
|
|
return this;
|
|
|
};
|
|
|
- // Statics
|
|
|
/**
|
|
|
* Creates a new Color3 from the string containing valid hexadecimal values
|
|
|
* @param hex defines a string containing valid hexadecimal values
|
|
@@ -4022,6 +4021,16 @@ var BABYLON;
|
|
|
* @returns a new Color3 object
|
|
|
*/
|
|
|
Color3.Black = function () { return new Color3(0, 0, 0); };
|
|
|
+ Object.defineProperty(Color3, "BlackReadOnly", {
|
|
|
+ /**
|
|
|
+ * Gets a Color3 value containing a black color that must not be updated
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ return Color3._BlackReadOnly;
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
/**
|
|
|
* Returns a Color3 value containing a white color
|
|
|
* @returns a new Color3 object
|
|
@@ -4057,6 +4066,8 @@ var BABYLON;
|
|
|
* @returns a new Color3 object
|
|
|
*/
|
|
|
Color3.Random = function () { return new Color3(Math.random(), Math.random(), Math.random()); };
|
|
|
+ // Statics
|
|
|
+ Color3._BlackReadOnly = Color3.Black();
|
|
|
return Color3;
|
|
|
}());
|
|
|
BABYLON.Color3 = Color3;
|
|
@@ -12974,7 +12985,7 @@ var BABYLON;
|
|
|
* Returns the current version of the framework
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return "4.0.0-alpha.12";
|
|
|
+ return "4.0.0-alpha.14";
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -45132,7 +45143,7 @@ var BABYLON;
|
|
|
if (defines.SPECULARTERM) {
|
|
|
this._uniformBuffer.updateColor4("vSpecularColor", this.specularColor, this.specularPower);
|
|
|
}
|
|
|
- this._uniformBuffer.updateColor3("vEmissiveColor", this.emissiveColor);
|
|
|
+ this._uniformBuffer.updateColor3("vEmissiveColor", StandardMaterial.EmissiveTextureEnabled ? this.emissiveColor : BABYLON.Color3.BlackReadOnly);
|
|
|
// Diffuse
|
|
|
this._uniformBuffer.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);
|
|
|
}
|
|
@@ -47505,7 +47516,7 @@ var BABYLON;
|
|
|
else {
|
|
|
this._uniformBuffer.updateColor4("vReflectivityColor", this._reflectivityColor, this._microSurface);
|
|
|
}
|
|
|
- this._uniformBuffer.updateColor3("vEmissiveColor", this._emissiveColor);
|
|
|
+ this._uniformBuffer.updateColor3("vEmissiveColor", BABYLON.StandardMaterial.EmissiveTextureEnabled ? this._emissiveColor : BABYLON.Color3.BlackReadOnly);
|
|
|
this._uniformBuffer.updateColor3("vReflectionColor", this._reflectionColor);
|
|
|
this._uniformBuffer.updateColor4("vAlbedoColor", this._albedoColor, this.alpha * mesh.visibility);
|
|
|
// Misc
|
|
@@ -49834,31 +49845,33 @@ var BABYLON;
|
|
|
});
|
|
|
this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function (info) {
|
|
|
var evt = info.event;
|
|
|
- if (info.type === BABYLON.KeyboardEventTypes.KEYDOWN) {
|
|
|
- if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysDown.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysRight.indexOf(evt.keyCode) !== -1) {
|
|
|
- var index = _this._keys.indexOf(evt.keyCode);
|
|
|
- if (index === -1) {
|
|
|
- _this._keys.push(evt.keyCode);
|
|
|
- }
|
|
|
- if (!noPreventDefault) {
|
|
|
- evt.preventDefault();
|
|
|
+ if (!evt.metaKey) {
|
|
|
+ if (info.type === BABYLON.KeyboardEventTypes.KEYDOWN) {
|
|
|
+ if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysDown.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysRight.indexOf(evt.keyCode) !== -1) {
|
|
|
+ var index = _this._keys.indexOf(evt.keyCode);
|
|
|
+ if (index === -1) {
|
|
|
+ _this._keys.push(evt.keyCode);
|
|
|
+ }
|
|
|
+ if (!noPreventDefault) {
|
|
|
+ evt.preventDefault();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
- if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysDown.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysRight.indexOf(evt.keyCode) !== -1) {
|
|
|
- var index = _this._keys.indexOf(evt.keyCode);
|
|
|
- if (index >= 0) {
|
|
|
- _this._keys.splice(index, 1);
|
|
|
- }
|
|
|
- if (!noPreventDefault) {
|
|
|
- evt.preventDefault();
|
|
|
+ else {
|
|
|
+ if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysDown.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysRight.indexOf(evt.keyCode) !== -1) {
|
|
|
+ var index = _this._keys.indexOf(evt.keyCode);
|
|
|
+ if (index >= 0) {
|
|
|
+ _this._keys.splice(index, 1);
|
|
|
+ }
|
|
|
+ if (!noPreventDefault) {
|
|
|
+ evt.preventDefault();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -51252,38 +51265,40 @@ var BABYLON;
|
|
|
});
|
|
|
this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function (info) {
|
|
|
var evt = info.event;
|
|
|
- if (info.type === BABYLON.KeyboardEventTypes.KEYDOWN) {
|
|
|
- _this._ctrlPressed = evt.ctrlKey;
|
|
|
- _this._altPressed = evt.altKey;
|
|
|
- if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysDown.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysRight.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysReset.indexOf(evt.keyCode) !== -1) {
|
|
|
- var index = _this._keys.indexOf(evt.keyCode);
|
|
|
- if (index === -1) {
|
|
|
- _this._keys.push(evt.keyCode);
|
|
|
- }
|
|
|
- if (evt.preventDefault) {
|
|
|
- if (!noPreventDefault) {
|
|
|
- evt.preventDefault();
|
|
|
+ if (!evt.metaKey) {
|
|
|
+ if (info.type === BABYLON.KeyboardEventTypes.KEYDOWN) {
|
|
|
+ _this._ctrlPressed = evt.ctrlKey;
|
|
|
+ _this._altPressed = evt.altKey;
|
|
|
+ if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysDown.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysRight.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysReset.indexOf(evt.keyCode) !== -1) {
|
|
|
+ var index = _this._keys.indexOf(evt.keyCode);
|
|
|
+ if (index === -1) {
|
|
|
+ _this._keys.push(evt.keyCode);
|
|
|
+ }
|
|
|
+ if (evt.preventDefault) {
|
|
|
+ if (!noPreventDefault) {
|
|
|
+ evt.preventDefault();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
- if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysDown.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysRight.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysReset.indexOf(evt.keyCode) !== -1) {
|
|
|
- var index = _this._keys.indexOf(evt.keyCode);
|
|
|
- if (index >= 0) {
|
|
|
- _this._keys.splice(index, 1);
|
|
|
- }
|
|
|
- if (evt.preventDefault) {
|
|
|
- if (!noPreventDefault) {
|
|
|
- evt.preventDefault();
|
|
|
+ else {
|
|
|
+ if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysDown.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysRight.indexOf(evt.keyCode) !== -1 ||
|
|
|
+ _this.keysReset.indexOf(evt.keyCode) !== -1) {
|
|
|
+ var index = _this._keys.indexOf(evt.keyCode);
|
|
|
+ if (index >= 0) {
|
|
|
+ _this._keys.splice(index, 1);
|
|
|
+ }
|
|
|
+ if (evt.preventDefault) {
|
|
|
+ if (!noPreventDefault) {
|
|
|
+ evt.preventDefault();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|