|
@@ -1679,7 +1679,6 @@ var BABYLON;
|
|
|
*/
|
|
|
Color3.FromHexString = function (hex) {
|
|
|
if (hex.substring(0, 1) !== "#" || hex.length !== 7) {
|
|
|
- //Tools.Warn("Color3.FromHexString must be called with a string like #FFFFFF");
|
|
|
return new Color3(0, 0, 0);
|
|
|
}
|
|
|
var r = parseInt(hex.substring(1, 3), 16);
|
|
@@ -2071,7 +2070,6 @@ var BABYLON;
|
|
|
*/
|
|
|
Color4.FromHexString = function (hex) {
|
|
|
if (hex.substring(0, 1) !== "#" || hex.length !== 9) {
|
|
|
- //Tools.Warn("Color4.FromHexString must be called with a string like #FFFFFFFF");
|
|
|
return new Color4(0.0, 0.0, 0.0, 0.0);
|
|
|
}
|
|
|
var r = parseInt(hex.substring(1, 3), 16);
|
|
@@ -6198,7 +6196,6 @@ var BABYLON;
|
|
|
*/
|
|
|
Path2.prototype.addLineTo = function (x, y) {
|
|
|
if (this.closed) {
|
|
|
- //Tools.Error("cannot add lines to closed paths");
|
|
|
return this;
|
|
|
}
|
|
|
var newPoint = new Vector2(x, y);
|
|
@@ -6214,7 +6211,6 @@ var BABYLON;
|
|
|
Path2.prototype.addArcTo = function (midX, midY, endX, endY, numberOfSegments) {
|
|
|
if (numberOfSegments === void 0) { numberOfSegments = 36; }
|
|
|
if (this.closed) {
|
|
|
- //Tools.Error("cannot add arcs to closed paths");
|
|
|
return this;
|
|
|
}
|
|
|
var startPoint = this._points[this._points.length - 1];
|
|
@@ -6264,7 +6260,6 @@ var BABYLON;
|
|
|
*/
|
|
|
Path2.prototype.getPointAtLengthPosition = function (normalizedLengthPosition) {
|
|
|
if (normalizedLengthPosition < 0 || normalizedLengthPosition > 1) {
|
|
|
- //Tools.Error("normalized length position should be between 0 and 1.");
|
|
|
return Vector2.Zero();
|
|
|
}
|
|
|
var lengthPosition = normalizedLengthPosition * this.length();
|
|
@@ -6282,7 +6277,6 @@ var BABYLON;
|
|
|
}
|
|
|
previousOffset = nextOffset;
|
|
|
}
|
|
|
- //Tools.Error("internal error");
|
|
|
return Vector2.Zero();
|
|
|
};
|
|
|
/**
|
|
@@ -51689,9 +51683,10 @@ var BABYLON;
|
|
|
SphereParticleEmitter.prototype.startPositionFunction = function (worldMatrix, positionToUpdate, particle) {
|
|
|
var phi = BABYLON.Scalar.RandomRange(0, 2 * Math.PI);
|
|
|
var theta = BABYLON.Scalar.RandomRange(0, Math.PI);
|
|
|
- var randX = this.radius * Math.cos(phi) * Math.sin(theta);
|
|
|
- var randY = this.radius * Math.cos(theta);
|
|
|
- var randZ = this.radius * Math.sin(phi) * Math.sin(theta);
|
|
|
+ var randRadius = BABYLON.Scalar.RandomRange(0, this.radius);
|
|
|
+ var randX = randRadius * Math.cos(phi) * Math.sin(theta);
|
|
|
+ var randY = randRadius * Math.cos(theta);
|
|
|
+ var randZ = randRadius * Math.sin(phi) * Math.sin(theta);
|
|
|
BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate);
|
|
|
};
|
|
|
/**
|
|
@@ -55722,7 +55717,7 @@ var BABYLON;
|
|
|
* Returns whether Draco compression is supported.
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return !!window.DracoDecoderModule;
|
|
|
+ return BABYLON.Tools.IsWindowObjectExist() && !!window.DracoDecoderModule;
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -92132,6 +92127,7 @@ var BABYLON;
|
|
|
_this._progressCallback = onProgress;
|
|
|
_this._state = BABYLON.GLTFLoaderState.Loading;
|
|
|
_this._loadData(data);
|
|
|
+ _this._checkExtensions();
|
|
|
var promises = new Array();
|
|
|
if (nodes) {
|
|
|
promises.push(_this._loadNodesAsync(nodes));
|
|
@@ -92228,6 +92224,17 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+ GLTFLoader.prototype._checkExtensions = function () {
|
|
|
+ if (this._gltf.extensionsRequired) {
|
|
|
+ for (var _i = 0, _a = this._gltf.extensionsRequired; _i < _a.length; _i++) {
|
|
|
+ var name_2 = _a[_i];
|
|
|
+ var extension = this._extensions[name_2];
|
|
|
+ if (!extension || !extension.enabled) {
|
|
|
+ throw new Error("Require extension " + name_2 + " is not available");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
GLTFLoader.prototype._createRootNode = function () {
|
|
|
this._rootBabylonMesh = new BABYLON.Mesh("__root__", this._babylonScene);
|
|
|
var rootNode = { _babylonMesh: this._rootBabylonMesh };
|
|
@@ -93370,8 +93377,8 @@ var BABYLON;
|
|
|
};
|
|
|
GLTFLoader.prototype._applyExtensions = function (actionAsync) {
|
|
|
for (var _i = 0, _a = GLTFLoader._Names; _i < _a.length; _i++) {
|
|
|
- var name_2 = _a[_i];
|
|
|
- var extension = this._extensions[name_2];
|
|
|
+ var name_3 = _a[_i];
|
|
|
+ var extension = this._extensions[name_3];
|
|
|
if (extension.enabled) {
|
|
|
var promise = actionAsync(extension);
|
|
|
if (promise) {
|