|
@@ -10897,6 +10897,16 @@ var BABYLON;
|
|
enumerable: true,
|
|
enumerable: true,
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
|
|
+ Object.defineProperty(Engine, "TEXTUREFORMAT_RGBA32F", {
|
|
|
|
+ /**
|
|
|
|
+ * RGBA32F
|
|
|
|
+ */
|
|
|
|
+ get: function () {
|
|
|
|
+ return Engine._TEXTUREFORMAT_RGBA32F;
|
|
|
|
+ },
|
|
|
|
+ enumerable: true,
|
|
|
|
+ configurable: true
|
|
|
|
+ });
|
|
Object.defineProperty(Engine, "TEXTUREFORMAT_LUMINANCE_ALPHA", {
|
|
Object.defineProperty(Engine, "TEXTUREFORMAT_LUMINANCE_ALPHA", {
|
|
get: function () {
|
|
get: function () {
|
|
return Engine._TEXTUREFORMAT_LUMINANCE_ALPHA;
|
|
return Engine._TEXTUREFORMAT_LUMINANCE_ALPHA;
|
|
@@ -10962,7 +10972,7 @@ var BABYLON;
|
|
});
|
|
});
|
|
Object.defineProperty(Engine, "Version", {
|
|
Object.defineProperty(Engine, "Version", {
|
|
get: function () {
|
|
get: function () {
|
|
- return "3.2.0-alpha7";
|
|
|
|
|
|
+ return "3.2.0-alpha8";
|
|
},
|
|
},
|
|
enumerable: true,
|
|
enumerable: true,
|
|
configurable: true
|
|
configurable: true
|
|
@@ -12994,6 +13004,7 @@ var BABYLON;
|
|
internalFormat = this._gl.RGB;
|
|
internalFormat = this._gl.RGB;
|
|
break;
|
|
break;
|
|
case Engine.TEXTUREFORMAT_RGBA:
|
|
case Engine.TEXTUREFORMAT_RGBA:
|
|
|
|
+ case Engine.TEXTUREFORMAT_RGBA32F:
|
|
internalFormat = this._gl.RGBA;
|
|
internalFormat = this._gl.RGBA;
|
|
break;
|
|
break;
|
|
case Engine.TEXTUREFORMAT_R32F:
|
|
case Engine.TEXTUREFORMAT_R32F:
|
|
@@ -15060,6 +15071,7 @@ var BABYLON;
|
|
Engine._TEXTUREFORMAT_R32F = 6;
|
|
Engine._TEXTUREFORMAT_R32F = 6;
|
|
Engine._TEXTUREFORMAT_RG32F = 7;
|
|
Engine._TEXTUREFORMAT_RG32F = 7;
|
|
Engine._TEXTUREFORMAT_RGB32F = 8;
|
|
Engine._TEXTUREFORMAT_RGB32F = 8;
|
|
|
|
+ Engine._TEXTUREFORMAT_RGBA32F = 9;
|
|
Engine._TEXTURETYPE_UNSIGNED_INT = 0;
|
|
Engine._TEXTURETYPE_UNSIGNED_INT = 0;
|
|
Engine._TEXTURETYPE_FLOAT = 1;
|
|
Engine._TEXTURETYPE_FLOAT = 1;
|
|
Engine._TEXTURETYPE_HALF_FLOAT = 2;
|
|
Engine._TEXTURETYPE_HALF_FLOAT = 2;
|
|
@@ -25724,10 +25736,6 @@ var BABYLON;
|
|
*/
|
|
*/
|
|
VertexBuffer.DeduceStride = function (kind) {
|
|
VertexBuffer.DeduceStride = function (kind) {
|
|
switch (kind) {
|
|
switch (kind) {
|
|
- case VertexBuffer.PositionKind:
|
|
|
|
- return 3;
|
|
|
|
- case VertexBuffer.NormalKind:
|
|
|
|
- return 3;
|
|
|
|
case VertexBuffer.UVKind:
|
|
case VertexBuffer.UVKind:
|
|
case VertexBuffer.UV2Kind:
|
|
case VertexBuffer.UV2Kind:
|
|
case VertexBuffer.UV3Kind:
|
|
case VertexBuffer.UV3Kind:
|
|
@@ -25735,14 +25743,15 @@ var BABYLON;
|
|
case VertexBuffer.UV5Kind:
|
|
case VertexBuffer.UV5Kind:
|
|
case VertexBuffer.UV6Kind:
|
|
case VertexBuffer.UV6Kind:
|
|
return 2;
|
|
return 2;
|
|
- case VertexBuffer.TangentKind:
|
|
|
|
|
|
+ case VertexBuffer.NormalKind:
|
|
|
|
+ case VertexBuffer.PositionKind:
|
|
|
|
+ return 3;
|
|
case VertexBuffer.ColorKind:
|
|
case VertexBuffer.ColorKind:
|
|
- return 4;
|
|
|
|
case VertexBuffer.MatricesIndicesKind:
|
|
case VertexBuffer.MatricesIndicesKind:
|
|
case VertexBuffer.MatricesIndicesExtraKind:
|
|
case VertexBuffer.MatricesIndicesExtraKind:
|
|
- return 4;
|
|
|
|
case VertexBuffer.MatricesWeightsKind:
|
|
case VertexBuffer.MatricesWeightsKind:
|
|
case VertexBuffer.MatricesWeightsExtraKind:
|
|
case VertexBuffer.MatricesWeightsExtraKind:
|
|
|
|
+ case VertexBuffer.TangentKind:
|
|
return 4;
|
|
return 4;
|
|
default:
|
|
default:
|
|
throw new Error("Invalid kind '" + kind + "'");
|
|
throw new Error("Invalid kind '" + kind + "'");
|
|
@@ -27672,7 +27681,7 @@ var BABYLON;
|
|
weight = matricesWeightsData[matWeightIdx + inf];
|
|
weight = matricesWeightsData[matWeightIdx + inf];
|
|
if (weight <= 0)
|
|
if (weight <= 0)
|
|
break;
|
|
break;
|
|
- BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[matWeightIdx + inf] * 16, weight, tempMatrix);
|
|
|
|
|
|
+ BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesData[matWeightIdx + inf] * 16), weight, tempMatrix);
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
}
|
|
}
|
|
if (needExtras) {
|
|
if (needExtras) {
|
|
@@ -27680,7 +27689,7 @@ var BABYLON;
|
|
weight = matricesWeightsExtraData[matWeightIdx + inf];
|
|
weight = matricesWeightsExtraData[matWeightIdx + inf];
|
|
if (weight <= 0)
|
|
if (weight <= 0)
|
|
break;
|
|
break;
|
|
- BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesExtraData[matWeightIdx + inf] * 16, weight, tempMatrix);
|
|
|
|
|
|
+ BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesExtraData[matWeightIdx + inf] * 16), weight, tempMatrix);
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -29821,7 +29830,7 @@ var BABYLON;
|
|
for (inf = 0; inf < 4; inf++) {
|
|
for (inf = 0; inf < 4; inf++) {
|
|
weight = matricesWeightsData[matWeightIdx + inf];
|
|
weight = matricesWeightsData[matWeightIdx + inf];
|
|
if (weight > 0) {
|
|
if (weight > 0) {
|
|
- BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[matWeightIdx + inf] * 16, weight, tempMatrix);
|
|
|
|
|
|
+ BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesData[matWeightIdx + inf] * 16), weight, tempMatrix);
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -29831,7 +29840,7 @@ var BABYLON;
|
|
for (inf = 0; inf < 4; inf++) {
|
|
for (inf = 0; inf < 4; inf++) {
|
|
weight = matricesWeightsExtraData[matWeightIdx + inf];
|
|
weight = matricesWeightsExtraData[matWeightIdx + inf];
|
|
if (weight > 0) {
|
|
if (weight > 0) {
|
|
- BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesExtraData[matWeightIdx + inf] * 16, weight, tempMatrix);
|
|
|
|
|
|
+ BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesExtraData[matWeightIdx + inf] * 16), weight, tempMatrix);
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -50541,22 +50550,6 @@ var BABYLON;
|
|
*/
|
|
*/
|
|
this.gravity = BABYLON.Vector3.Zero();
|
|
this.gravity = BABYLON.Vector3.Zero();
|
|
/**
|
|
/**
|
|
- * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
|
- */
|
|
|
|
- this.direction1 = new BABYLON.Vector3(0, 1.0, 0);
|
|
|
|
- /**
|
|
|
|
- * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
|
- */
|
|
|
|
- this.direction2 = new BABYLON.Vector3(0, 1.0, 0);
|
|
|
|
- /**
|
|
|
|
- * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
|
- */
|
|
|
|
- this.minEmitBox = new BABYLON.Vector3(-0.5, -0.5, -0.5);
|
|
|
|
- /**
|
|
|
|
- * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
|
- */
|
|
|
|
- this.maxEmitBox = new BABYLON.Vector3(0.5, 0.5, 0.5);
|
|
|
|
- /**
|
|
|
|
* Random color of each particle after it has been emitted, between color1 and color2 vectors.
|
|
* Random color of each particle after it has been emitted, between color1 and color2 vectors.
|
|
*/
|
|
*/
|
|
this.color1 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0);
|
|
this.color1 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0);
|
|
@@ -50639,8 +50632,8 @@ var BABYLON;
|
|
this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = positions;
|
|
this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = positions;
|
|
this._vertexBuffers[BABYLON.VertexBuffer.ColorKind] = colors;
|
|
this._vertexBuffers[BABYLON.VertexBuffer.ColorKind] = colors;
|
|
this._vertexBuffers["options"] = options;
|
|
this._vertexBuffers["options"] = options;
|
|
- // Default behaviors
|
|
|
|
- this.particleEmitterType = new BABYLON.BoxParticleEmitter(this);
|
|
|
|
|
|
+ // Default emitter type
|
|
|
|
+ this.particleEmitterType = new BABYLON.BoxParticleEmitter();
|
|
this.updateFunction = function (particles) {
|
|
this.updateFunction = function (particles) {
|
|
for (var index = 0; index < particles.length; index++) {
|
|
for (var index = 0; index < particles.length; index++) {
|
|
var particle = particles[index];
|
|
var particle = particles[index];
|
|
@@ -50667,6 +50660,82 @@ var BABYLON;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
+ Object.defineProperty(ParticleSystem.prototype, "direction1", {
|
|
|
|
+ /**
|
|
|
|
+ * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
|
+ * This only works when particleEmitterTyps is a BoxParticleEmitter
|
|
|
|
+ */
|
|
|
|
+ get: function () {
|
|
|
|
+ if (this.particleEmitterType.direction1) {
|
|
|
|
+ return this.particleEmitterType.direction1;
|
|
|
|
+ }
|
|
|
|
+ return BABYLON.Vector3.Zero();
|
|
|
|
+ },
|
|
|
|
+ set: function (value) {
|
|
|
|
+ if (this.particleEmitterType.direction1) {
|
|
|
|
+ this.particleEmitterType.direction1 = value;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ enumerable: true,
|
|
|
|
+ configurable: true
|
|
|
|
+ });
|
|
|
|
+ Object.defineProperty(ParticleSystem.prototype, "direction2", {
|
|
|
|
+ /**
|
|
|
|
+ * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
|
+ * This only works when particleEmitterTyps is a BoxParticleEmitter
|
|
|
|
+ */
|
|
|
|
+ get: function () {
|
|
|
|
+ if (this.particleEmitterType.direction2) {
|
|
|
|
+ return this.particleEmitterType.direction2;
|
|
|
|
+ }
|
|
|
|
+ return BABYLON.Vector3.Zero();
|
|
|
|
+ },
|
|
|
|
+ set: function (value) {
|
|
|
|
+ if (this.particleEmitterType.direction2) {
|
|
|
|
+ this.particleEmitterType.direction2 = value;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ enumerable: true,
|
|
|
|
+ configurable: true
|
|
|
|
+ });
|
|
|
|
+ Object.defineProperty(ParticleSystem.prototype, "minEmitBox", {
|
|
|
|
+ /**
|
|
|
|
+ * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
|
+ * This only works when particleEmitterTyps is a BoxParticleEmitter
|
|
|
|
+ */
|
|
|
|
+ get: function () {
|
|
|
|
+ if (this.particleEmitterType.minEmitBox) {
|
|
|
|
+ return this.particleEmitterType.minEmitBox;
|
|
|
|
+ }
|
|
|
|
+ return BABYLON.Vector3.Zero();
|
|
|
|
+ },
|
|
|
|
+ set: function (value) {
|
|
|
|
+ if (this.particleEmitterType.minEmitBox) {
|
|
|
|
+ this.particleEmitterType.minEmitBox = value;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ enumerable: true,
|
|
|
|
+ configurable: true
|
|
|
|
+ });
|
|
|
|
+ Object.defineProperty(ParticleSystem.prototype, "maxEmitBox", {
|
|
|
|
+ /**
|
|
|
|
+ * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
|
+ * This only works when particleEmitterTyps is a BoxParticleEmitter
|
|
|
|
+ */
|
|
|
|
+ get: function () {
|
|
|
|
+ if (this.particleEmitterType.maxEmitBox) {
|
|
|
|
+ return this.particleEmitterType.maxEmitBox;
|
|
|
|
+ }
|
|
|
|
+ return BABYLON.Vector3.Zero();
|
|
|
|
+ },
|
|
|
|
+ set: function (value) {
|
|
|
|
+ if (this.particleEmitterType.maxEmitBox) {
|
|
|
|
+ this.particleEmitterType.maxEmitBox = value;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ enumerable: true,
|
|
|
|
+ configurable: true
|
|
|
|
+ });
|
|
Object.defineProperty(ParticleSystem.prototype, "onDispose", {
|
|
Object.defineProperty(ParticleSystem.prototype, "onDispose", {
|
|
/**
|
|
/**
|
|
* Sets a callback that will be triggered when the system is disposed.
|
|
* Sets a callback that will be triggered when the system is disposed.
|
|
@@ -50974,13 +51043,14 @@ var BABYLON;
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
* Renders the particle system in its current state.
|
|
* Renders the particle system in its current state.
|
|
- * @returns the current number of particles.
|
|
|
|
|
|
+ * @returns the current number of particles
|
|
*/
|
|
*/
|
|
ParticleSystem.prototype.render = function () {
|
|
ParticleSystem.prototype.render = function () {
|
|
var effect = this._getEffect();
|
|
var effect = this._getEffect();
|
|
// Check
|
|
// Check
|
|
- if (!this.emitter || !effect.isReady() || !this.particleTexture || !this.particleTexture.isReady() || !this._particles.length)
|
|
|
|
|
|
+ if (!this.emitter || !effect.isReady() || !this.particleTexture || !this.particleTexture.isReady() || !this._particles.length) {
|
|
return 0;
|
|
return 0;
|
|
|
|
+ }
|
|
var engine = this._scene.getEngine();
|
|
var engine = this._scene.getEngine();
|
|
// Render
|
|
// Render
|
|
engine.enableEffect(effect);
|
|
engine.enableEffect(effect);
|
|
@@ -51091,7 +51161,7 @@ var BABYLON;
|
|
* @returns the emitter
|
|
* @returns the emitter
|
|
*/
|
|
*/
|
|
ParticleSystem.prototype.createBoxEmitter = function (direction1, direction2, minEmitBox, maxEmitBox) {
|
|
ParticleSystem.prototype.createBoxEmitter = function (direction1, direction2, minEmitBox, maxEmitBox) {
|
|
- var particleEmitter = new BABYLON.BoxParticleEmitter(this);
|
|
|
|
|
|
+ var particleEmitter = new BABYLON.BoxParticleEmitter();
|
|
this.direction1 = direction1;
|
|
this.direction1 = direction1;
|
|
this.direction2 = direction2;
|
|
this.direction2 = direction2;
|
|
this.minEmitBox = minEmitBox;
|
|
this.minEmitBox = minEmitBox;
|
|
@@ -51286,79 +51356,27 @@ var BABYLON;
|
|
* It emits the particles randomly between 2 given directions.
|
|
* It emits the particles randomly between 2 given directions.
|
|
*/
|
|
*/
|
|
var BoxParticleEmitter = /** @class */ (function () {
|
|
var BoxParticleEmitter = /** @class */ (function () {
|
|
- // to be updated like the rest of emitters when breaking changes.
|
|
|
|
- // all property should be come public variables and passed through constructor.
|
|
|
|
/**
|
|
/**
|
|
* Creates a new instance of @see BoxParticleEmitter
|
|
* Creates a new instance of @see BoxParticleEmitter
|
|
- * @param _particleSystem the particle system associated with the emitter
|
|
|
|
*/
|
|
*/
|
|
- function BoxParticleEmitter(_particleSystem) {
|
|
|
|
- this._particleSystem = _particleSystem;
|
|
|
|
- }
|
|
|
|
- Object.defineProperty(BoxParticleEmitter.prototype, "direction1", {
|
|
|
|
- /**
|
|
|
|
- * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
|
- */
|
|
|
|
- get: function () {
|
|
|
|
- return this._particleSystem.direction1;
|
|
|
|
- },
|
|
|
|
- /**
|
|
|
|
- * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
|
- */
|
|
|
|
- set: function (value) {
|
|
|
|
- this._particleSystem.direction1 = value;
|
|
|
|
- },
|
|
|
|
- enumerable: true,
|
|
|
|
- configurable: true
|
|
|
|
- });
|
|
|
|
- Object.defineProperty(BoxParticleEmitter.prototype, "direction2", {
|
|
|
|
|
|
+ function BoxParticleEmitter() {
|
|
/**
|
|
/**
|
|
* Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
* Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
*/
|
|
*/
|
|
- get: function () {
|
|
|
|
- return this._particleSystem.direction2;
|
|
|
|
- },
|
|
|
|
|
|
+ this.direction1 = new BABYLON.Vector3(0, 1.0, 0);
|
|
/**
|
|
/**
|
|
* Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
* Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
*/
|
|
*/
|
|
- set: function (value) {
|
|
|
|
- this._particleSystem.direction2 = value;
|
|
|
|
- },
|
|
|
|
- enumerable: true,
|
|
|
|
- configurable: true
|
|
|
|
- });
|
|
|
|
- Object.defineProperty(BoxParticleEmitter.prototype, "minEmitBox", {
|
|
|
|
- /**
|
|
|
|
- * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
|
- */
|
|
|
|
- get: function () {
|
|
|
|
- return this._particleSystem.minEmitBox;
|
|
|
|
- },
|
|
|
|
|
|
+ this.direction2 = new BABYLON.Vector3(0, 1.0, 0);
|
|
/**
|
|
/**
|
|
* Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
* Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
*/
|
|
*/
|
|
- set: function (value) {
|
|
|
|
- this._particleSystem.minEmitBox = value;
|
|
|
|
- },
|
|
|
|
- enumerable: true,
|
|
|
|
- configurable: true
|
|
|
|
- });
|
|
|
|
- Object.defineProperty(BoxParticleEmitter.prototype, "maxEmitBox", {
|
|
|
|
- /**
|
|
|
|
- * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
|
- */
|
|
|
|
- get: function () {
|
|
|
|
- return this._particleSystem.maxEmitBox;
|
|
|
|
- },
|
|
|
|
|
|
+ this.minEmitBox = new BABYLON.Vector3(-0.5, -0.5, -0.5);
|
|
/**
|
|
/**
|
|
* Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
* Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
*/
|
|
*/
|
|
- set: function (value) {
|
|
|
|
- this._particleSystem.maxEmitBox = value;
|
|
|
|
- },
|
|
|
|
- enumerable: true,
|
|
|
|
- configurable: true
|
|
|
|
- });
|
|
|
|
|
|
+ this.maxEmitBox = new BABYLON.Vector3(0.5, 0.5, 0.5);
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* Called by the particle System when the direction is computed for the created particle.
|
|
* Called by the particle System when the direction is computed for the created particle.
|
|
* @param emitPower is the power of the particle (speed)
|
|
* @param emitPower is the power of the particle (speed)
|
|
@@ -51389,10 +51407,27 @@ var BABYLON;
|
|
* @returns the new emitter
|
|
* @returns the new emitter
|
|
*/
|
|
*/
|
|
BoxParticleEmitter.prototype.clone = function () {
|
|
BoxParticleEmitter.prototype.clone = function () {
|
|
- var newOne = new BoxParticleEmitter(this._particleSystem);
|
|
|
|
|
|
+ var newOne = new BoxParticleEmitter();
|
|
BABYLON.Tools.DeepCopy(this, newOne);
|
|
BABYLON.Tools.DeepCopy(this, newOne);
|
|
return newOne;
|
|
return newOne;
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Called by the {BABYLON.GPUParticleSystem} to setup the update shader
|
|
|
|
+ * @param effect defines the update shader
|
|
|
|
+ */
|
|
|
|
+ BoxParticleEmitter.prototype.applyToShader = function (effect) {
|
|
|
|
+ effect.setVector3("direction1", this.direction1);
|
|
|
|
+ effect.setVector3("direction2", this.direction2);
|
|
|
|
+ effect.setVector3("minEmitBox", this.minEmitBox);
|
|
|
|
+ effect.setVector3("maxEmitBox", this.maxEmitBox);
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Returns a string to use to update the GPU particles update shader
|
|
|
|
+ * @returns a string containng the defines string
|
|
|
|
+ */
|
|
|
|
+ BoxParticleEmitter.prototype.getEffectDefines = function () {
|
|
|
|
+ return "#define BOXEMITTER";
|
|
|
|
+ };
|
|
return BoxParticleEmitter;
|
|
return BoxParticleEmitter;
|
|
}());
|
|
}());
|
|
BABYLON.BoxParticleEmitter = BoxParticleEmitter;
|
|
BABYLON.BoxParticleEmitter = BoxParticleEmitter;
|
|
@@ -51489,7 +51524,7 @@ var BABYLON;
|
|
radius = radius * h / this._height;
|
|
radius = radius * h / this._height;
|
|
var randX = radius * Math.sin(s);
|
|
var randX = radius * Math.sin(s);
|
|
var randZ = radius * Math.cos(s);
|
|
var randZ = radius * Math.cos(s);
|
|
- var randY = h;
|
|
|
|
|
|
+ var randY = h * this._height;
|
|
BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate);
|
|
BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate);
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
@@ -51501,6 +51536,23 @@ var BABYLON;
|
|
BABYLON.Tools.DeepCopy(this, newOne);
|
|
BABYLON.Tools.DeepCopy(this, newOne);
|
|
return newOne;
|
|
return newOne;
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Called by the {BABYLON.GPUParticleSystem} to setup the update shader
|
|
|
|
+ * @param effect defines the update shader
|
|
|
|
+ */
|
|
|
|
+ ConeParticleEmitter.prototype.applyToShader = function (effect) {
|
|
|
|
+ effect.setFloat("radius", this.radius);
|
|
|
|
+ effect.setFloat("angle", this.angle);
|
|
|
|
+ effect.setFloat("height", this._height);
|
|
|
|
+ effect.setFloat("directionRandomizer", this.directionRandomizer);
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Returns a string to use to update the GPU particles update shader
|
|
|
|
+ * @returns a string containng the defines string
|
|
|
|
+ */
|
|
|
|
+ ConeParticleEmitter.prototype.getEffectDefines = function () {
|
|
|
|
+ return "#define CONEEMITTER";
|
|
|
|
+ };
|
|
return ConeParticleEmitter;
|
|
return ConeParticleEmitter;
|
|
}());
|
|
}());
|
|
BABYLON.ConeParticleEmitter = ConeParticleEmitter;
|
|
BABYLON.ConeParticleEmitter = ConeParticleEmitter;
|
|
@@ -51575,6 +51627,21 @@ var BABYLON;
|
|
BABYLON.Tools.DeepCopy(this, newOne);
|
|
BABYLON.Tools.DeepCopy(this, newOne);
|
|
return newOne;
|
|
return newOne;
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Called by the {BABYLON.GPUParticleSystem} to setup the update shader
|
|
|
|
+ * @param effect defines the update shader
|
|
|
|
+ */
|
|
|
|
+ SphereParticleEmitter.prototype.applyToShader = function (effect) {
|
|
|
|
+ effect.setFloat("radius", this.radius);
|
|
|
|
+ effect.setFloat("directionRandomizer", this.directionRandomizer);
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Returns a string to use to update the GPU particles update shader
|
|
|
|
+ * @returns a string containng the defines string
|
|
|
|
+ */
|
|
|
|
+ SphereParticleEmitter.prototype.getEffectDefines = function () {
|
|
|
|
+ return "#define SPHEREEMITTER";
|
|
|
|
+ };
|
|
return SphereParticleEmitter;
|
|
return SphereParticleEmitter;
|
|
}());
|
|
}());
|
|
BABYLON.SphereParticleEmitter = SphereParticleEmitter;
|
|
BABYLON.SphereParticleEmitter = SphereParticleEmitter;
|
|
@@ -51626,6 +51693,22 @@ var BABYLON;
|
|
BABYLON.Tools.DeepCopy(this, newOne);
|
|
BABYLON.Tools.DeepCopy(this, newOne);
|
|
return newOne;
|
|
return newOne;
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Called by the {BABYLON.GPUParticleSystem} to setup the update shader
|
|
|
|
+ * @param effect defines the update shader
|
|
|
|
+ */
|
|
|
|
+ SphereDirectedParticleEmitter.prototype.applyToShader = function (effect) {
|
|
|
|
+ effect.setFloat("radius", this.radius);
|
|
|
|
+ effect.setVector3("direction1", this.direction1);
|
|
|
|
+ effect.setVector3("direction2", this.direction2);
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Returns a string to use to update the GPU particles update shader
|
|
|
|
+ * @returns a string containng the defines string
|
|
|
|
+ */
|
|
|
|
+ SphereDirectedParticleEmitter.prototype.getEffectDefines = function () {
|
|
|
|
+ return "#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER";
|
|
|
|
+ };
|
|
return SphereDirectedParticleEmitter;
|
|
return SphereDirectedParticleEmitter;
|
|
}(SphereParticleEmitter));
|
|
}(SphereParticleEmitter));
|
|
BABYLON.SphereDirectedParticleEmitter = SphereDirectedParticleEmitter;
|
|
BABYLON.SphereDirectedParticleEmitter = SphereDirectedParticleEmitter;
|
|
@@ -51635,7 +51718,7 @@ var BABYLON;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-//# sourceMappingURL=babylon.iParticleEmitterType.js.map
|
|
|
|
|
|
+//# sourceMappingURL=babylon.IParticleEmitterType.js.map
|
|
|
|
|
|
var BABYLON;
|
|
var BABYLON;
|
|
(function (BABYLON) {
|
|
(function (BABYLON) {
|
|
@@ -55491,6 +55574,110 @@ var BABYLON;
|
|
|
|
|
|
//# sourceMappingURL=babylon.meshBuilder.js.map
|
|
//# sourceMappingURL=babylon.meshBuilder.js.map
|
|
|
|
|
|
|
|
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
|
|
|
|
+var BABYLON;
|
|
|
|
+(function (BABYLON) {
|
|
|
|
+ /**
|
|
|
|
+ * Draco compression (https://google.github.io/draco/)
|
|
|
|
+ */
|
|
|
|
+ var DracoCompression = /** @class */ (function () {
|
|
|
|
+ function DracoCompression() {
|
|
|
|
+ }
|
|
|
|
+ Object.defineProperty(DracoCompression, "IsSupported", {
|
|
|
|
+ /**
|
|
|
|
+ * Returns whether Draco compression is supported.
|
|
|
|
+ */
|
|
|
|
+ get: function () {
|
|
|
|
+ return !!window.DracoDecoderModule;
|
|
|
|
+ },
|
|
|
|
+ enumerable: true,
|
|
|
|
+ configurable: true
|
|
|
|
+ });
|
|
|
|
+ /**
|
|
|
|
+ * Decodes Draco compressed data to vertex data.
|
|
|
|
+ * @param data The array buffer view for the Draco compression data
|
|
|
|
+ * @param attributes A map of attributes from vertex buffer kinds to Draco unique ids
|
|
|
|
+ * @returns The decoded vertex data
|
|
|
|
+ */
|
|
|
|
+ DracoCompression.Decode = function (data, attributes) {
|
|
|
|
+ var dracoModule = new DracoDecoderModule();
|
|
|
|
+ var buffer = new dracoModule.DecoderBuffer();
|
|
|
|
+ buffer.Init(data, data.byteLength);
|
|
|
|
+ var decoder = new dracoModule.Decoder();
|
|
|
|
+ var geometry;
|
|
|
|
+ var status;
|
|
|
|
+ var vertexData = new BABYLON.VertexData();
|
|
|
|
+ try {
|
|
|
|
+ var type = decoder.GetEncodedGeometryType(buffer);
|
|
|
|
+ switch (type) {
|
|
|
|
+ case dracoModule.TRIANGULAR_MESH:
|
|
|
|
+ geometry = new dracoModule.Mesh();
|
|
|
|
+ status = decoder.DecodeBufferToMesh(buffer, geometry);
|
|
|
|
+ break;
|
|
|
|
+ case dracoModule.POINT_CLOUD:
|
|
|
|
+ geometry = new dracoModule.PointCloud();
|
|
|
|
+ status = decoder.DecodeBufferToPointCloud(buffer, geometry);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ throw new Error("Invalid geometry type " + type);
|
|
|
|
+ }
|
|
|
|
+ if (!status.ok() || !geometry.ptr) {
|
|
|
|
+ throw new Error(status.error_msg());
|
|
|
|
+ }
|
|
|
|
+ var numPoints = geometry.num_points();
|
|
|
|
+ if (type === dracoModule.TRIANGULAR_MESH) {
|
|
|
|
+ var numFaces = geometry.num_faces();
|
|
|
|
+ var faceIndices = new dracoModule.DracoInt32Array();
|
|
|
|
+ try {
|
|
|
|
+ vertexData.indices = new Uint32Array(numFaces * 3);
|
|
|
|
+ for (var i = 0; i < numFaces; i++) {
|
|
|
|
+ decoder.GetFaceFromMesh(geometry, i, faceIndices);
|
|
|
|
+ var offset = i * 3;
|
|
|
|
+ vertexData.indices[offset + 0] = faceIndices.GetValue(0);
|
|
|
|
+ vertexData.indices[offset + 1] = faceIndices.GetValue(1);
|
|
|
|
+ vertexData.indices[offset + 2] = faceIndices.GetValue(2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ finally {
|
|
|
|
+ dracoModule.destroy(faceIndices);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (var kind in attributes) {
|
|
|
|
+ var uniqueId = attributes[kind];
|
|
|
|
+ var attribute = decoder.GetAttributeByUniqueId(geometry, uniqueId);
|
|
|
|
+ var dracoData = new dracoModule.DracoFloat32Array();
|
|
|
|
+ try {
|
|
|
|
+ if (attribute.num_components() !== BABYLON.VertexBuffer.DeduceStride(kind)) {
|
|
|
|
+ throw new Error("Unsupported number of components for " + kind);
|
|
|
|
+ }
|
|
|
|
+ decoder.GetAttributeFloatForAllPoints(geometry, attribute, dracoData);
|
|
|
|
+ var babylonData = new Float32Array(numPoints * attribute.num_components());
|
|
|
|
+ for (var i = 0; i < babylonData.length; i++) {
|
|
|
|
+ babylonData[i] = dracoData.GetValue(i);
|
|
|
|
+ }
|
|
|
|
+ vertexData.set(babylonData, kind);
|
|
|
|
+ }
|
|
|
|
+ finally {
|
|
|
|
+ dracoModule.destroy(dracoData);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ finally {
|
|
|
|
+ if (geometry) {
|
|
|
|
+ dracoModule.destroy(geometry);
|
|
|
|
+ }
|
|
|
|
+ dracoModule.destroy(decoder);
|
|
|
|
+ dracoModule.destroy(buffer);
|
|
|
|
+ }
|
|
|
|
+ return vertexData;
|
|
|
|
+ };
|
|
|
|
+ return DracoCompression;
|
|
|
|
+ }());
|
|
|
|
+ BABYLON.DracoCompression = DracoCompression;
|
|
|
|
+})(BABYLON || (BABYLON = {}));
|
|
|
|
+
|
|
|
|
+//# sourceMappingURL=babylon.dracoCompression.js.map
|
|
|
|
+
|
|
var BABYLON;
|
|
var BABYLON;
|
|
(function (BABYLON) {
|
|
(function (BABYLON) {
|
|
var AudioEngine = /** @class */ (function () {
|
|
var AudioEngine = /** @class */ (function () {
|
|
@@ -80216,7 +80403,6 @@ var BABYLON;
|
|
imageProcessingConfiguration.vignetteEnabled = true;
|
|
imageProcessingConfiguration.vignetteEnabled = true;
|
|
this._postProcessMove = new BABYLON.ImageProcessingPostProcess("postProcessMove", 1.0, this._webVRCamera, undefined, undefined, undefined, undefined, imageProcessingConfiguration);
|
|
this._postProcessMove = new BABYLON.ImageProcessingPostProcess("postProcessMove", 1.0, this._webVRCamera, undefined, undefined, undefined, undefined, imageProcessingConfiguration);
|
|
this._webVRCamera.detachPostProcess(this._postProcessMove);
|
|
this._webVRCamera.detachPostProcess(this._postProcessMove);
|
|
- this._passProcessMove = new BABYLON.PassPostProcess("pass", 1.0, this._webVRCamera);
|
|
|
|
this._teleportationInitialized = true;
|
|
this._teleportationInitialized = true;
|
|
if (this._isDefaultTeleportationTarget) {
|
|
if (this._isDefaultTeleportationTarget) {
|
|
this._createTeleportationCircles();
|
|
this._createTeleportationCircles();
|
|
@@ -80585,6 +80771,7 @@ var BABYLON;
|
|
this._postProcessMove.animations.push(animationPP2);
|
|
this._postProcessMove.animations.push(animationPP2);
|
|
this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0;
|
|
this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0;
|
|
this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0;
|
|
this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0;
|
|
|
|
+ this._postProcessMove.samples = 4;
|
|
this._webVRCamera.attachPostProcess(this._postProcessMove);
|
|
this._webVRCamera.attachPostProcess(this._postProcessMove);
|
|
this._scene.beginAnimation(this._postProcessMove, 0, 6, false, 1, function () {
|
|
this._scene.beginAnimation(this._postProcessMove, 0, 6, false, 1, function () {
|
|
_this._webVRCamera.detachPostProcess(_this._postProcessMove);
|
|
_this._webVRCamera.detachPostProcess(_this._postProcessMove);
|
|
@@ -80854,9 +81041,6 @@ var BABYLON;
|
|
if (this.isInVRMode) {
|
|
if (this.isInVRMode) {
|
|
this.exitVR();
|
|
this.exitVR();
|
|
}
|
|
}
|
|
- if (this._passProcessMove) {
|
|
|
|
- this._passProcessMove.dispose();
|
|
|
|
- }
|
|
|
|
if (this._postProcessMove) {
|
|
if (this._postProcessMove) {
|
|
this._postProcessMove.dispose();
|
|
this._postProcessMove.dispose();
|
|
}
|
|
}
|
|
@@ -92091,11 +92275,15 @@ var BABYLON;
|
|
};
|
|
};
|
|
GLTFLoader.prototype._loadVertexDataAsync = function (context, primitive, babylonMesh) {
|
|
GLTFLoader.prototype._loadVertexDataAsync = function (context, primitive, babylonMesh) {
|
|
var _this = this;
|
|
var _this = this;
|
|
|
|
+ var promise = GLTF2.GLTFLoaderExtension._LoadVertexDataAsync(this, context, primitive, babylonMesh);
|
|
|
|
+ if (promise) {
|
|
|
|
+ return promise;
|
|
|
|
+ }
|
|
var attributes = primitive.attributes;
|
|
var attributes = primitive.attributes;
|
|
if (!attributes) {
|
|
if (!attributes) {
|
|
throw new Error(context + ": Attributes are missing");
|
|
throw new Error(context + ": Attributes are missing");
|
|
}
|
|
}
|
|
- if (primitive.mode && primitive.mode !== 4 /* TRIANGLES */) {
|
|
|
|
|
|
+ if (primitive.mode != undefined && primitive.mode !== 4 /* TRIANGLES */) {
|
|
// TODO: handle other primitive modes
|
|
// TODO: handle other primitive modes
|
|
throw new Error(context + ": Mode " + primitive.mode + " is not currently supported");
|
|
throw new Error(context + ": Mode " + primitive.mode + " is not currently supported");
|
|
}
|
|
}
|
|
@@ -93079,6 +93267,8 @@ var BABYLON;
|
|
GLTFLoaderExtension.prototype._loadSceneAsync = function (context, node) { return null; };
|
|
GLTFLoaderExtension.prototype._loadSceneAsync = function (context, node) { return null; };
|
|
/** Override this method to modify the default behavior for loading nodes. */
|
|
/** Override this method to modify the default behavior for loading nodes. */
|
|
GLTFLoaderExtension.prototype._loadNodeAsync = function (context, node) { return null; };
|
|
GLTFLoaderExtension.prototype._loadNodeAsync = function (context, node) { return null; };
|
|
|
|
+ /** Override this method to modify the default behavior for loading mesh primitive vertex data. */
|
|
|
|
+ GLTFLoaderExtension.prototype._loadVertexDataAsync = function (context, primitive, babylonMesh) { return null; };
|
|
/** Override this method to modify the default behavior for loading materials. */
|
|
/** Override this method to modify the default behavior for loading materials. */
|
|
GLTFLoaderExtension.prototype._loadMaterialAsync = function (context, material, babylonMesh) { return null; };
|
|
GLTFLoaderExtension.prototype._loadMaterialAsync = function (context, material, babylonMesh) { return null; };
|
|
/** Override this method to modify the default behavior for loading uris. */
|
|
/** Override this method to modify the default behavior for loading uris. */
|
|
@@ -93086,7 +93276,6 @@ var BABYLON;
|
|
// #endregion
|
|
// #endregion
|
|
/** Helper method called by a loader extension to load an glTF extension. */
|
|
/** Helper method called by a loader extension to load an glTF extension. */
|
|
GLTFLoaderExtension.prototype._loadExtensionAsync = function (context, property, actionAsync) {
|
|
GLTFLoaderExtension.prototype._loadExtensionAsync = function (context, property, actionAsync) {
|
|
- var _this = this;
|
|
|
|
if (!property.extensions) {
|
|
if (!property.extensions) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -93097,10 +93286,13 @@ var BABYLON;
|
|
}
|
|
}
|
|
// Clear out the extension before executing the action to avoid recursing into the same property.
|
|
// Clear out the extension before executing the action to avoid recursing into the same property.
|
|
delete extensions[this.name];
|
|
delete extensions[this.name];
|
|
- return actionAsync(context + "/extensions/" + this.name, extension).then(function () {
|
|
|
|
- // Restore the extension after completing the action.
|
|
|
|
- extensions[_this.name] = extension;
|
|
|
|
- });
|
|
|
|
|
|
+ try {
|
|
|
|
+ return actionAsync(context + "/extensions/" + this.name, extension);
|
|
|
|
+ }
|
|
|
|
+ finally {
|
|
|
|
+ // Restore the extension after executing the action.
|
|
|
|
+ extensions[this.name] = extension;
|
|
|
|
+ }
|
|
};
|
|
};
|
|
/** Helper method called by the loader to allow extensions to override loading scenes. */
|
|
/** Helper method called by the loader to allow extensions to override loading scenes. */
|
|
GLTFLoaderExtension._LoadSceneAsync = function (loader, context, scene) {
|
|
GLTFLoaderExtension._LoadSceneAsync = function (loader, context, scene) {
|
|
@@ -93110,6 +93302,10 @@ var BABYLON;
|
|
GLTFLoaderExtension._LoadNodeAsync = function (loader, context, node) {
|
|
GLTFLoaderExtension._LoadNodeAsync = function (loader, context, node) {
|
|
return loader._applyExtensions(function (extension) { return extension._loadNodeAsync(context, node); });
|
|
return loader._applyExtensions(function (extension) { return extension._loadNodeAsync(context, node); });
|
|
};
|
|
};
|
|
|
|
+ /** Helper method called by the loader to allow extensions to override loading mesh primitive vertex data. */
|
|
|
|
+ GLTFLoaderExtension._LoadVertexDataAsync = function (loader, context, primitive, babylonMesh) {
|
|
|
|
+ return loader._applyExtensions(function (extension) { return extension._loadVertexDataAsync(context, primitive, babylonMesh); });
|
|
|
|
+ };
|
|
/** Helper method called by the loader to allow extensions to override loading materials. */
|
|
/** Helper method called by the loader to allow extensions to override loading materials. */
|
|
GLTFLoaderExtension._LoadMaterialAsync = function (loader, context, material, babylonMesh) {
|
|
GLTFLoaderExtension._LoadMaterialAsync = function (loader, context, material, babylonMesh) {
|
|
return loader._applyExtensions(function (extension) { return extension._loadMaterialAsync(context, material, babylonMesh); });
|
|
return loader._applyExtensions(function (extension) { return extension._loadMaterialAsync(context, material, babylonMesh); });
|
|
@@ -93275,6 +93471,79 @@ var BABYLON;
|
|
(function (GLTF2) {
|
|
(function (GLTF2) {
|
|
var Extensions;
|
|
var Extensions;
|
|
(function (Extensions) {
|
|
(function (Extensions) {
|
|
|
|
+ // https://github.com/KhronosGroup/glTF/pull/874
|
|
|
|
+ var NAME = "KHR_draco_mesh_compression";
|
|
|
|
+ var KHR_draco_mesh_compression = /** @class */ (function (_super) {
|
|
|
|
+ __extends(KHR_draco_mesh_compression, _super);
|
|
|
|
+ function KHR_draco_mesh_compression() {
|
|
|
|
+ var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
|
|
+ _this.name = NAME;
|
|
|
|
+ return _this;
|
|
|
|
+ }
|
|
|
|
+ KHR_draco_mesh_compression.prototype._loadVertexDataAsync = function (context, primitive, babylonMesh) {
|
|
|
|
+ var _this = this;
|
|
|
|
+ return this._loadExtensionAsync(context, primitive, function (extensionContext, extension) {
|
|
|
|
+ if (primitive.mode != undefined) {
|
|
|
|
+ if (primitive.mode !== 5 /* TRIANGLE_STRIP */ &&
|
|
|
|
+ primitive.mode !== 4 /* TRIANGLES */) {
|
|
|
|
+ throw new Error(context + ": Unsupported mode " + primitive.mode);
|
|
|
|
+ }
|
|
|
|
+ // TODO: handle triangle strips
|
|
|
|
+ if (primitive.mode === 5 /* TRIANGLE_STRIP */) {
|
|
|
|
+ throw new Error(context + ": Mode " + primitive.mode + " is not currently supported");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ var attributes = {};
|
|
|
|
+ var loadAttribute = function (name, kind) {
|
|
|
|
+ var uniqueId = extension.attributes[name];
|
|
|
|
+ if (uniqueId == undefined) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ babylonMesh._delayInfo = babylonMesh._delayInfo || [];
|
|
|
|
+ if (babylonMesh._delayInfo.indexOf(kind) === -1) {
|
|
|
|
+ babylonMesh._delayInfo.push(kind);
|
|
|
|
+ }
|
|
|
|
+ attributes[kind] = uniqueId;
|
|
|
|
+ };
|
|
|
|
+ loadAttribute("POSITION", BABYLON.VertexBuffer.PositionKind);
|
|
|
|
+ loadAttribute("NORMAL", BABYLON.VertexBuffer.NormalKind);
|
|
|
|
+ loadAttribute("TANGENT", BABYLON.VertexBuffer.TangentKind);
|
|
|
|
+ loadAttribute("TEXCOORD_0", BABYLON.VertexBuffer.UVKind);
|
|
|
|
+ loadAttribute("TEXCOORD_1", BABYLON.VertexBuffer.UV2Kind);
|
|
|
|
+ loadAttribute("JOINTS_0", BABYLON.VertexBuffer.MatricesIndicesKind);
|
|
|
|
+ loadAttribute("WEIGHTS_0", BABYLON.VertexBuffer.MatricesWeightsKind);
|
|
|
|
+ loadAttribute("COLOR_0", BABYLON.VertexBuffer.ColorKind);
|
|
|
|
+ var bufferView = GLTF2.GLTFLoader._GetProperty(extensionContext, _this._loader._gltf.bufferViews, extension.bufferView);
|
|
|
|
+ return _this._loader._loadBufferViewAsync("#/bufferViews/" + bufferView._index, bufferView).then(function (data) {
|
|
|
|
+ try {
|
|
|
|
+ return BABYLON.DracoCompression.Decode(data, attributes);
|
|
|
|
+ }
|
|
|
|
+ catch (e) {
|
|
|
|
+ throw new Error(context + ": " + e.message);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ return KHR_draco_mesh_compression;
|
|
|
|
+ }(GLTF2.GLTFLoaderExtension));
|
|
|
|
+ Extensions.KHR_draco_mesh_compression = KHR_draco_mesh_compression;
|
|
|
|
+ if (BABYLON.DracoCompression.IsSupported) {
|
|
|
|
+ GLTF2.GLTFLoader._Register(NAME, function (loader) { return new KHR_draco_mesh_compression(loader); });
|
|
|
|
+ }
|
|
|
|
+ })(Extensions = GLTF2.Extensions || (GLTF2.Extensions = {}));
|
|
|
|
+ })(GLTF2 = BABYLON.GLTF2 || (BABYLON.GLTF2 = {}));
|
|
|
|
+})(BABYLON || (BABYLON = {}));
|
|
|
|
+
|
|
|
|
+//# sourceMappingURL=KHR_draco_mesh_compression.js.map
|
|
|
|
+
|
|
|
|
+/// <reference path="../../../../../dist/preview release/babylon.d.ts"/>
|
|
|
|
+
|
|
|
|
+var BABYLON;
|
|
|
|
+(function (BABYLON) {
|
|
|
|
+ var GLTF2;
|
|
|
|
+ (function (GLTF2) {
|
|
|
|
+ var Extensions;
|
|
|
|
+ (function (Extensions) {
|
|
// https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness
|
|
// https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness
|
|
var NAME = "KHR_materials_pbrSpecularGlossiness";
|
|
var NAME = "KHR_materials_pbrSpecularGlossiness";
|
|
var KHR_materials_pbrSpecularGlossiness = /** @class */ (function (_super) {
|
|
var KHR_materials_pbrSpecularGlossiness = /** @class */ (function (_super) {
|