|
@@ -7403,26 +7403,39 @@ var BABYLON;
|
|
|
};
|
|
|
/**
|
|
|
* Returns a Curve3 object along a CatmullRom Spline curve :
|
|
|
- * @param points (array of Vector3) the points the spline must pass through. At least, four points required.
|
|
|
- * @param nbPoints (integer) the wanted number of points between each curve control points.
|
|
|
- */
|
|
|
- Curve3.CreateCatmullRomSpline = function (points, nbPoints) {
|
|
|
- var totalPoints = new Array();
|
|
|
- totalPoints.push(points[0].clone());
|
|
|
- Array.prototype.push.apply(totalPoints, points);
|
|
|
- totalPoints.push(points[points.length - 1].clone());
|
|
|
+ * @param points (array of Vector3) the points the spline must pass through. At least, four points required
|
|
|
+ * @param nbPoints (integer) the wanted number of points between each curve control points
|
|
|
+ * @param closed (boolean) optional with default false, when true forms a closed loop from the points
|
|
|
+ */
|
|
|
+ Curve3.CreateCatmullRomSpline = function (points, nbPoints, closed) {
|
|
|
var catmullRom = new Array();
|
|
|
var step = 1.0 / nbPoints;
|
|
|
var amount = 0.0;
|
|
|
- for (var i = 0; i < totalPoints.length - 3; i++) {
|
|
|
- amount = 0;
|
|
|
- for (var c = 0; c < nbPoints; c++) {
|
|
|
- catmullRom.push(Vector3.CatmullRom(totalPoints[i], totalPoints[i + 1], totalPoints[i + 2], totalPoints[i + 3], amount));
|
|
|
- amount += step;
|
|
|
+ if (closed) {
|
|
|
+ var pointsCount = points.length;
|
|
|
+ for (var i = 0; i < pointsCount; i++) {
|
|
|
+ amount = 0;
|
|
|
+ for (var c = 0; c < nbPoints; c++) {
|
|
|
+ catmullRom.push(Vector3.CatmullRom(points[i % pointsCount], points[(i + 1) % pointsCount], points[(i + 2) % pointsCount], points[(i + 3) % pointsCount], amount));
|
|
|
+ amount += step;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ var totalPoints = new Array();
|
|
|
+ totalPoints.push(points[0].clone());
|
|
|
+ Array.prototype.push.apply(totalPoints, points);
|
|
|
+ totalPoints.push(points[points.length - 1].clone());
|
|
|
+ for (var i = 0; i < totalPoints.length - 3; i++) {
|
|
|
+ amount = 0;
|
|
|
+ for (var c = 0; c < nbPoints; c++) {
|
|
|
+ catmullRom.push(Vector3.CatmullRom(totalPoints[i], totalPoints[i + 1], totalPoints[i + 2], totalPoints[i + 3], amount));
|
|
|
+ amount += step;
|
|
|
+ }
|
|
|
}
|
|
|
+ i--;
|
|
|
+ catmullRom.push(Vector3.CatmullRom(totalPoints[i], totalPoints[i + 1], totalPoints[i + 2], totalPoints[i + 3], amount));
|
|
|
}
|
|
|
- i--;
|
|
|
- catmullRom.push(Vector3.CatmullRom(totalPoints[i], totalPoints[i + 1], totalPoints[i + 2], totalPoints[i + 3], amount));
|
|
|
return new Curve3(catmullRom);
|
|
|
};
|
|
|
/**
|
|
@@ -12127,7 +12140,7 @@ var BABYLON;
|
|
|
* Returns the current version of the framework
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return "3.2.0";
|
|
|
+ return "3.3.0-alpha.0";
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -30665,6 +30678,18 @@ var BABYLON;
|
|
|
_this.uAng = 0;
|
|
|
_this.vAng = 0;
|
|
|
_this.wAng = 0;
|
|
|
+ /**
|
|
|
+ * Defines the center of rotation (U)
|
|
|
+ */
|
|
|
+ _this.uRotationCenter = 0.5;
|
|
|
+ /**
|
|
|
+ * Defines the center of rotation (V)
|
|
|
+ */
|
|
|
+ _this.vRotationCenter = 0.5;
|
|
|
+ /**
|
|
|
+ * Defines the center of rotation (W)
|
|
|
+ */
|
|
|
+ _this.wRotationCenter = 0.5;
|
|
|
_this._isBlocking = true;
|
|
|
_this.name = url || "";
|
|
|
_this.url = url;
|
|
@@ -30793,13 +30818,13 @@ var BABYLON;
|
|
|
Texture.prototype._prepareRowForTextureGeneration = function (x, y, z, t) {
|
|
|
x *= this.uScale;
|
|
|
y *= this.vScale;
|
|
|
- x -= 0.5 * this.uScale;
|
|
|
- y -= 0.5 * this.vScale;
|
|
|
- z -= 0.5;
|
|
|
+ x -= this.uRotationCenter * this.uScale;
|
|
|
+ y -= this.vRotationCenter * this.vScale;
|
|
|
+ z -= this.wRotationCenter;
|
|
|
BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix, t);
|
|
|
- t.x += 0.5 * this.uScale + this.uOffset;
|
|
|
- t.y += 0.5 * this.vScale + this.vOffset;
|
|
|
- t.z += 0.5;
|
|
|
+ t.x += this.uRotationCenter * this.uScale + this.uOffset;
|
|
|
+ t.y += this.vRotationCenter * this.vScale + this.vOffset;
|
|
|
+ t.z += this.wRotationCenter;
|
|
|
};
|
|
|
Texture.prototype.getTextureMatrix = function () {
|
|
|
var _this = this;
|
|
@@ -31095,6 +31120,15 @@ var BABYLON;
|
|
|
], Texture.prototype, "wAng", void 0);
|
|
|
__decorate([
|
|
|
BABYLON.serialize()
|
|
|
+ ], Texture.prototype, "uRotationCenter", void 0);
|
|
|
+ __decorate([
|
|
|
+ BABYLON.serialize()
|
|
|
+ ], Texture.prototype, "vRotationCenter", void 0);
|
|
|
+ __decorate([
|
|
|
+ BABYLON.serialize()
|
|
|
+ ], Texture.prototype, "wRotationCenter", void 0);
|
|
|
+ __decorate([
|
|
|
+ BABYLON.serialize()
|
|
|
], Texture.prototype, "isBlocking", null);
|
|
|
return Texture;
|
|
|
}(BABYLON.BaseTexture));
|
|
@@ -52440,11 +52474,22 @@ var BABYLON;
|
|
|
var hostNormalizedFrame = (syncRoot.masterFrame - syncRoot.fromFrame) / (syncRoot.toFrame - syncRoot.fromFrame);
|
|
|
currentFrame = from + (to - from) * hostNormalizedFrame;
|
|
|
}
|
|
|
+ // Reset events if looping
|
|
|
+ var events = this._animation.getEvents();
|
|
|
+ if (range > 0 && this.currentFrame > currentFrame ||
|
|
|
+ range < 0 && this.currentFrame < currentFrame) {
|
|
|
+ // Need to reset animation events
|
|
|
+ for (var index = 0; index < events.length; index++) {
|
|
|
+ if (!events[index].onlyOnce) {
|
|
|
+ // reset event, the animation is looping
|
|
|
+ events[index].isDone = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
var currentValue = this._interpolate(currentFrame, repeatCount, this._getCorrectLoopMode(), offsetValue, highLimitValue);
|
|
|
// Set value
|
|
|
this.setValue(currentValue, weight);
|
|
|
// Check events
|
|
|
- var events = this._animation.getEvents();
|
|
|
for (var index = 0; index < events.length; index++) {
|
|
|
// Make sure current frame has passed event frame and that event frame is within the current range
|
|
|
// Also, handle both forward and reverse animations
|
|
@@ -52461,10 +52506,6 @@ var BABYLON;
|
|
|
event.action();
|
|
|
} // Don't do anything if the event has already be done.
|
|
|
}
|
|
|
- else if (events[index].isDone && !events[index].onlyOnce) {
|
|
|
- // reset event, the animation is looping
|
|
|
- events[index].isDone = false;
|
|
|
- }
|
|
|
}
|
|
|
if (!returnValue) {
|
|
|
this._stopped = true;
|
|
@@ -76195,13 +76236,16 @@ var BABYLON;
|
|
|
__extends(DefaultRenderingPipeline, _super);
|
|
|
/**
|
|
|
* @constructor
|
|
|
- * @param {string} name - The rendering pipeline name
|
|
|
- * @param {BABYLON.Scene} scene - The scene linked to this pipeline
|
|
|
- * @param {any} ratio - The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5)
|
|
|
- * @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to
|
|
|
- * @param {boolean} automaticBuild - if false, you will have to manually call prepare() to update the pipeline
|
|
|
+ * @param {string} name - The rendering pipeline name (default: "")
|
|
|
+ * @param {boolean} hdr - If high dynamic range textures should be used (default: true)
|
|
|
+ * @param {BABYLON.Scene} scene - The scene linked to this pipeline (default: the last created scene)
|
|
|
+ * @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to (default: scene.cameras)
|
|
|
+ * @param {boolean} automaticBuild - if false, you will have to manually call prepare() to update the pipeline (default: true)
|
|
|
*/
|
|
|
function DefaultRenderingPipeline(name, hdr, scene, cameras, automaticBuild) {
|
|
|
+ if (name === void 0) { name = ""; }
|
|
|
+ if (hdr === void 0) { hdr = true; }
|
|
|
+ if (scene === void 0) { scene = BABYLON.Engine.LastCreatedScene; }
|
|
|
if (automaticBuild === void 0) { automaticBuild = true; }
|
|
|
var _this = _super.call(this, scene.getEngine(), name) || this;
|
|
|
_this._originalCameras = [];
|
|
@@ -76226,6 +76270,10 @@ var BABYLON;
|
|
|
*/
|
|
|
_this.GrainPostProcessId = "GrainPostProcessEffect";
|
|
|
/**
|
|
|
+ * Glow post process which adds a glow to emmisive areas of the image
|
|
|
+ */
|
|
|
+ _this._glowLayer = null;
|
|
|
+ /**
|
|
|
* Animations which can be used to tweak settings over a period of time
|
|
|
*/
|
|
|
_this.animations = [];
|
|
@@ -76256,7 +76304,7 @@ var BABYLON;
|
|
|
_this._hasCleared = false;
|
|
|
_this._prevPostProcess = null;
|
|
|
_this._prevPrevPostProcess = null;
|
|
|
- _this._cameras = cameras || [];
|
|
|
+ _this._cameras = cameras || scene.cameras;
|
|
|
_this._originalCameras = _this._cameras.slice();
|
|
|
_this._buildAllowed = automaticBuild;
|
|
|
// Initialize
|
|
@@ -76503,6 +76551,25 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ Object.defineProperty(DefaultRenderingPipeline.prototype, "glowLayerEnabled", {
|
|
|
+ get: function () {
|
|
|
+ return this._glowLayer == null;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * If glow layer is enabled. (Adds a glow effect to emmissive materials)
|
|
|
+ */
|
|
|
+ set: function (enabled) {
|
|
|
+ if (enabled && !this._glowLayer) {
|
|
|
+ this._glowLayer = new BABYLON.GlowLayer("", this._scene);
|
|
|
+ }
|
|
|
+ else if (!enabled && this._glowLayer) {
|
|
|
+ this._glowLayer.dispose();
|
|
|
+ this._glowLayer = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
Object.defineProperty(DefaultRenderingPipeline.prototype, "chromaticAberrationEnabled", {
|
|
|
get: function () {
|
|
|
return this._chromaticAberrationEnabled;
|
|
@@ -76672,6 +76739,9 @@ var BABYLON;
|
|
|
if (this.grain) {
|
|
|
this.grain.dispose(camera);
|
|
|
}
|
|
|
+ if (this._glowLayer) {
|
|
|
+ this._glowLayer.dispose();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
this.imageProcessing = null;
|
|
@@ -76685,6 +76755,7 @@ var BABYLON;
|
|
|
this._chromaticAberrationEffect = null;
|
|
|
this.grain = null;
|
|
|
this._grainEffect = null;
|
|
|
+ this._glowLayer = null;
|
|
|
}
|
|
|
};
|
|
|
/**
|
|
@@ -76764,6 +76835,9 @@ var BABYLON;
|
|
|
], DefaultRenderingPipeline.prototype, "imageProcessingEnabled", null);
|
|
|
__decorate([
|
|
|
BABYLON.serialize()
|
|
|
+ ], DefaultRenderingPipeline.prototype, "glowLayerEnabled", null);
|
|
|
+ __decorate([
|
|
|
+ BABYLON.serialize()
|
|
|
], DefaultRenderingPipeline.prototype, "chromaticAberrationEnabled", null);
|
|
|
__decorate([
|
|
|
BABYLON.serialize()
|
|
@@ -106443,6 +106517,10 @@ var BABYLON;
|
|
|
/** @hidden */
|
|
|
GLTFLoader.prototype._loadTextureAsync = function (context, textureInfo, assign) {
|
|
|
var _this = this;
|
|
|
+ var promise = GLTF2.GLTFLoaderExtension._LoadTextureAsync(this, context, textureInfo, assign);
|
|
|
+ if (promise) {
|
|
|
+ return promise;
|
|
|
+ }
|
|
|
var texture = GLTFLoader._GetProperty(context + "/index", this._gltf.textures, textureInfo.index);
|
|
|
context = "#/textures/" + textureInfo.index;
|
|
|
var promises = new Array();
|
|
@@ -106780,6 +106858,8 @@ var BABYLON;
|
|
|
GLTFLoaderExtension.prototype._loadVertexDataAsync = function (context, primitive, babylonMesh) { return null; };
|
|
|
/** Override this method to modify the default behavior for loading materials. */
|
|
|
GLTFLoaderExtension.prototype._loadMaterialAsync = function (context, material, babylonMesh, babylonDrawMode, assign) { return null; };
|
|
|
+ /** Override this method to modify the default behavior for loading textures. */
|
|
|
+ GLTFLoaderExtension.prototype._loadTextureAsync = function (context, textureInfo, assign) { return null; };
|
|
|
/** Override this method to modify the default behavior for loading uris. */
|
|
|
GLTFLoaderExtension.prototype._loadUriAsync = function (context, uri) { return null; };
|
|
|
// #endregion
|
|
@@ -106819,6 +106899,10 @@ var BABYLON;
|
|
|
GLTFLoaderExtension._LoadMaterialAsync = function (loader, context, material, babylonMesh, babylonDrawMode, assign) {
|
|
|
return loader._applyExtensions(function (extension) { return extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign); });
|
|
|
};
|
|
|
+ /** Helper method called by the loader to allow extensions to override loading textures. */
|
|
|
+ GLTFLoaderExtension._LoadTextureAsync = function (loader, context, textureInfo, assign) {
|
|
|
+ return loader._applyExtensions(function (extension) { return extension._loadTextureAsync(context, textureInfo, assign); });
|
|
|
+ };
|
|
|
/** Helper method called by the loader to allow extensions to override loading uris. */
|
|
|
GLTFLoaderExtension._LoadUriAsync = function (loader, context, uri) {
|
|
|
return loader._applyExtensions(function (extension) { return extension._loadUriAsync(context, uri); });
|
|
@@ -107426,6 +107510,58 @@ var BABYLON;
|
|
|
})(GLTF2 = BABYLON.GLTF2 || (BABYLON.GLTF2 = {}));
|
|
|
})(BABYLON || (BABYLON = {}));
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+var BABYLON;
|
|
|
+(function (BABYLON) {
|
|
|
+ var GLTF2;
|
|
|
+ (function (GLTF2) {
|
|
|
+ var Extensions;
|
|
|
+ (function (Extensions) {
|
|
|
+ var NAME = "KHR_texture_transform";
|
|
|
+ /**
|
|
|
+ * [Specification](https://github.com/AltspaceVR/glTF/blob/avr-sampler-offset-tile/extensions/2.0/Khronos/KHR_texture_transform/README.md) (Experimental)
|
|
|
+ */
|
|
|
+ var KHR_texture_transform = /** @class */ (function (_super) {
|
|
|
+ __extends(KHR_texture_transform, _super);
|
|
|
+ function KHR_texture_transform() {
|
|
|
+ var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
|
+ _this.name = NAME;
|
|
|
+ return _this;
|
|
|
+ }
|
|
|
+ KHR_texture_transform.prototype._loadTextureAsync = function (context, textureInfo, assign) {
|
|
|
+ var _this = this;
|
|
|
+ return this._loadExtensionAsync(context, textureInfo, function (extensionContext, extension) {
|
|
|
+ return _this._loader._loadTextureAsync(context, textureInfo, function (babylonTexture) {
|
|
|
+ if (extension.offset) {
|
|
|
+ babylonTexture.uOffset = extension.offset[0];
|
|
|
+ babylonTexture.vOffset = extension.offset[1];
|
|
|
+ }
|
|
|
+ // Always rotate around the origin.
|
|
|
+ babylonTexture.uRotationCenter = 0;
|
|
|
+ babylonTexture.vRotationCenter = 0;
|
|
|
+ if (extension.rotation) {
|
|
|
+ babylonTexture.wAng = -extension.rotation;
|
|
|
+ }
|
|
|
+ if (extension.scale) {
|
|
|
+ babylonTexture.uScale = extension.scale[0];
|
|
|
+ babylonTexture.vScale = extension.scale[1];
|
|
|
+ }
|
|
|
+ if (extension.texCoord != undefined) {
|
|
|
+ babylonTexture.coordinatesIndex = extension.texCoord;
|
|
|
+ }
|
|
|
+ assign(babylonTexture);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ };
|
|
|
+ return KHR_texture_transform;
|
|
|
+ }(GLTF2.GLTFLoaderExtension));
|
|
|
+ Extensions.KHR_texture_transform = KHR_texture_transform;
|
|
|
+ GLTF2.GLTFLoader._Register(NAME, function (loader) { return new KHR_texture_transform(loader); });
|
|
|
+ })(Extensions = GLTF2.Extensions || (GLTF2.Extensions = {}));
|
|
|
+ })(GLTF2 = BABYLON.GLTF2 || (BABYLON.GLTF2 = {}));
|
|
|
+})(BABYLON || (BABYLON = {}));
|
|
|
+
|
|
|
|
|
|
|
|
|
return BABYLON;
|
|
@@ -110678,7 +110814,7 @@ exports.extendedConfiguration = {
|
|
|
receiveShadows: true
|
|
|
},
|
|
|
lab: {
|
|
|
- assetsRootURL: '/assets/environment/',
|
|
|
+ assetsRootURL: 'https://viewer.babylonjs.com/assets/environment/',
|
|
|
environmentMap: {
|
|
|
texture: "EnvMap_2.0-256.env",
|
|
|
rotationY: 3,
|