|
@@ -3214,13 +3214,7 @@ var BABYLON;
|
|
|
* @returns the current updated Vector3
|
|
|
*/
|
|
|
Vector3.prototype.minimizeInPlace = function (other) {
|
|
|
- if (other.x < this.x)
|
|
|
- this.x = other.x;
|
|
|
- if (other.y < this.y)
|
|
|
- this.y = other.y;
|
|
|
- if (other.z < this.z)
|
|
|
- this.z = other.z;
|
|
|
- return this;
|
|
|
+ return this.minimizeInPlaceFromFloats(other.x, other.y, other.z);
|
|
|
};
|
|
|
/**
|
|
|
* Updates the current Vector3 with the maximal coordinate values between its and the given vector ones.
|
|
@@ -3228,12 +3222,32 @@ var BABYLON;
|
|
|
* @returns the current updated Vector3
|
|
|
*/
|
|
|
Vector3.prototype.maximizeInPlace = function (other) {
|
|
|
- if (other.x > this.x)
|
|
|
- this.x = other.x;
|
|
|
- if (other.y > this.y)
|
|
|
- this.y = other.y;
|
|
|
- if (other.z > this.z)
|
|
|
- this.z = other.z;
|
|
|
+ return this.maximizeInPlaceFromFloats(other.x, other.y, other.z);
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Updates the current Vector3 with the minimal coordinate values between its and the given coordinates
|
|
|
+ * @param x defines the x coordinate of the operand
|
|
|
+ * @param y defines the y coordinate of the operand
|
|
|
+ * @param z defines the z coordinate of the operand
|
|
|
+ * @returns the current updated Vector3
|
|
|
+ */
|
|
|
+ Vector3.prototype.minimizeInPlaceFromFloats = function (x, y, z) {
|
|
|
+ this.x = Math.min(this.x, x);
|
|
|
+ this.y = Math.min(this.y, y);
|
|
|
+ this.z = Math.min(this.z, z);
|
|
|
+ return this;
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Updates the current Vector3 with the maximal coordinate values between its and the given coordinates.
|
|
|
+ * @param x defines the x coordinate of the operand
|
|
|
+ * @param y defines the y coordinate of the operand
|
|
|
+ * @param z defines the z coordinate of the operand
|
|
|
+ * @returns the current updated Vector3
|
|
|
+ */
|
|
|
+ Vector3.prototype.maximizeInPlaceFromFloats = function (x, y, z) {
|
|
|
+ this.x = Math.max(this.x, x);
|
|
|
+ this.y = Math.max(this.y, y);
|
|
|
+ this.z = Math.max(this.z, z);
|
|
|
return this;
|
|
|
};
|
|
|
Object.defineProperty(Vector3.prototype, "isNonUniform", {
|
|
@@ -9503,9 +9517,12 @@ var BABYLON;
|
|
|
var minimum = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
|
|
|
var maximum = new BABYLON.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
|
|
|
for (var index = indexStart; index < indexStart + indexCount; index++) {
|
|
|
- var current = new BABYLON.Vector3(positions[indices[index] * 3], positions[indices[index] * 3 + 1], positions[indices[index] * 3 + 2]);
|
|
|
- minimum = BABYLON.Vector3.Minimize(current, minimum);
|
|
|
- maximum = BABYLON.Vector3.Maximize(current, maximum);
|
|
|
+ var offset = indices[index];
|
|
|
+ var x = positions[offset];
|
|
|
+ var y = positions[offset + 1];
|
|
|
+ var z = positions[offset + 2];
|
|
|
+ minimum.minimizeInPlaceFromFloats(x, y, z);
|
|
|
+ maximum.maximizeInPlaceFromFloats(x, y, z);
|
|
|
}
|
|
|
if (bias) {
|
|
|
minimum.x -= minimum.x * bias.x + bias.y;
|
|
@@ -9536,10 +9553,12 @@ var BABYLON;
|
|
|
if (!stride) {
|
|
|
stride = 3;
|
|
|
}
|
|
|
- for (var index = start; index < start + count; index++) {
|
|
|
- var current = new BABYLON.Vector3(positions[index * stride], positions[index * stride + 1], positions[index * stride + 2]);
|
|
|
- minimum = BABYLON.Vector3.Minimize(current, minimum);
|
|
|
- maximum = BABYLON.Vector3.Maximize(current, maximum);
|
|
|
+ for (var index = start, offset = start * stride; index < start + count; index++, offset += stride) {
|
|
|
+ var x = positions[offset];
|
|
|
+ var y = positions[offset + 1];
|
|
|
+ var z = positions[offset + 2];
|
|
|
+ minimum.minimizeInPlaceFromFloats(x, y, z);
|
|
|
+ maximum.maximizeInPlaceFromFloats(x, y, z);
|
|
|
}
|
|
|
if (bias) {
|
|
|
minimum.x -= minimum.x * bias.x + bias.y;
|
|
@@ -18295,6 +18314,8 @@ var BABYLON;
|
|
|
this._worldMatrix = BABYLON.Matrix.Identity();
|
|
|
/** @hidden */
|
|
|
this._worldMatrixDeterminant = 0;
|
|
|
+ /** @hidden */
|
|
|
+ this._sceneRootNodesIndex = -1;
|
|
|
this._animationPropertiesOverride = null;
|
|
|
/**
|
|
|
* An event triggered when the mesh is disposed
|
|
@@ -18307,7 +18328,7 @@ var BABYLON;
|
|
|
this._scene = (scene || BABYLON.Engine.LastCreatedScene);
|
|
|
this.uniqueId = this._scene.getUniqueId();
|
|
|
this._initCache();
|
|
|
- this._scene.rootNodes.push(this);
|
|
|
+ this.addToSceneRootNodes();
|
|
|
}
|
|
|
/**
|
|
|
* Add a new node constructor
|
|
@@ -18358,8 +18379,7 @@ var BABYLON;
|
|
|
this._parentNode._children.splice(index, 1);
|
|
|
}
|
|
|
if (!parent) {
|
|
|
- // Need to add this node to the rootNodes
|
|
|
- this._scene.rootNodes.push(this);
|
|
|
+ this.addToSceneRootNodes();
|
|
|
}
|
|
|
}
|
|
|
// Store new parent
|
|
@@ -18371,11 +18391,7 @@ var BABYLON;
|
|
|
}
|
|
|
this._parentNode._children.push(this);
|
|
|
if (!previousParentNode) {
|
|
|
- // Need to remove from rootNodes
|
|
|
- var rootNodeIndex = this._scene.rootNodes.indexOf(this);
|
|
|
- if (rootNodeIndex > -1) {
|
|
|
- this._scene.rootNodes.splice(rootNodeIndex, 1);
|
|
|
- }
|
|
|
+ this.removeFromSceneRootNodes();
|
|
|
}
|
|
|
}
|
|
|
// Enabled state
|
|
@@ -18384,6 +18400,22 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ Node.prototype.addToSceneRootNodes = function () {
|
|
|
+ if (this._sceneRootNodesIndex === -1) {
|
|
|
+ this._sceneRootNodesIndex = this._scene.rootNodes.length;
|
|
|
+ this._scene.rootNodes.push(this);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ Node.prototype.removeFromSceneRootNodes = function () {
|
|
|
+ if (this._sceneRootNodesIndex !== -1) {
|
|
|
+ var rootNodes = this._scene.rootNodes;
|
|
|
+ var lastIdx = rootNodes.length - 1;
|
|
|
+ rootNodes[this._sceneRootNodesIndex] = rootNodes[lastIdx];
|
|
|
+ rootNodes[this._sceneRootNodesIndex]._sceneRootNodesIndex = this._sceneRootNodesIndex;
|
|
|
+ this._scene.rootNodes.pop();
|
|
|
+ this._sceneRootNodesIndex = -1;
|
|
|
+ }
|
|
|
+ };
|
|
|
Object.defineProperty(Node.prototype, "animationPropertiesOverride", {
|
|
|
/**
|
|
|
* Gets or sets the animation properties override
|
|
@@ -18831,10 +18863,7 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
if (!this.parent) {
|
|
|
- var rootNodeIndex = this._scene.rootNodes.indexOf(this);
|
|
|
- if (rootNodeIndex > -1) {
|
|
|
- this._scene.rootNodes.splice(rootNodeIndex, 1);
|
|
|
- }
|
|
|
+ this.removeFromSceneRootNodes();
|
|
|
}
|
|
|
else {
|
|
|
this.parent = null;
|
|
@@ -39742,10 +39771,15 @@ var BABYLON;
|
|
|
* Gets or sets the Bias Vector to apply on the bounding elements (box/sphere), the max extend is computed as v += v * bias.x + bias.y, the min is computed as v -= v * bias.x + bias.y
|
|
|
*/
|
|
|
set: function (value) {
|
|
|
- if (this._boundingBias && this._boundingBias.equals(value)) {
|
|
|
- return;
|
|
|
+ if (this._boundingBias) {
|
|
|
+ if (this._boundingBias.equals(value)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this._boundingBias.copyFrom(value);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this._boundingBias = value.clone();
|
|
|
}
|
|
|
- this._boundingBias = value.clone();
|
|
|
this._updateBoundingInfo(true, null);
|
|
|
},
|
|
|
enumerable: true,
|
|
@@ -59286,6 +59320,7 @@ var BABYLON;
|
|
|
* @param gradient defines the gradient to use (between 0 and 1)
|
|
|
* @param color1 defines the color to affect to the specified gradient
|
|
|
* @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from
|
|
|
+ * @returns this particle system
|
|
|
*/
|
|
|
ParticleSystem.prototype.addColorGradient = function (gradient, color1, color2) {
|
|
|
if (!this._colorGradients) {
|
|
@@ -59310,6 +59345,7 @@ var BABYLON;
|
|
|
/**
|
|
|
* Remove a specific color gradient
|
|
|
* @param gradient defines the gradient to remove
|
|
|
+ * @returns this particle system
|
|
|
*/
|
|
|
ParticleSystem.prototype.removeColorGradient = function (gradient) {
|
|
|
if (!this._colorGradients) {
|
|
@@ -59810,6 +59846,7 @@ var BABYLON;
|
|
|
}
|
|
|
return attributeNamesOrOptions;
|
|
|
};
|
|
|
+ /** @hidden */
|
|
|
ParticleSystem._GetEffectCreationOptions = function (isAnimationSheetEnabled) {
|
|
|
if (isAnimationSheetEnabled === void 0) { isAnimationSheetEnabled = false; }
|
|
|
var effectCreationOption = ["invView", "view", "projection", "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "textureMask", "translationPivot", "eyePosition"];
|
|
@@ -59818,6 +59855,7 @@ var BABYLON;
|
|
|
}
|
|
|
return effectCreationOption;
|
|
|
};
|
|
|
+ /** @hidden */
|
|
|
ParticleSystem.prototype._getEffect = function (blendMode) {
|
|
|
if (this._customEffect) {
|
|
|
return this._customEffect;
|
|
@@ -68170,11 +68208,11 @@ var BABYLON;
|
|
|
path3D = storage.path3D.update(path);
|
|
|
pathArray = tubePathArray(path, path3D, storage.pathArray, radius, storage.tessellation, radiusFunction, storage.cap, arc);
|
|
|
instance = MeshBuilder.CreateRibbon("", { pathArray: pathArray, instance: instance });
|
|
|
- instance._creationDataStorage = new BABYLON._CreationDataStorage();
|
|
|
- instance._creationDataStorage.path3D = path3D;
|
|
|
- instance._creationDataStorage.pathArray = pathArray;
|
|
|
- instance._creationDataStorage.arc = arc;
|
|
|
- instance._creationDataStorage.radius = radius;
|
|
|
+ // Update mode, no need to recreate the storage.
|
|
|
+ storage.path3D = path3D;
|
|
|
+ storage.pathArray = pathArray;
|
|
|
+ storage.arc = arc;
|
|
|
+ storage.radius = radius;
|
|
|
return instance;
|
|
|
}
|
|
|
// tube creation
|
|
@@ -82177,13 +82215,31 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * PostProcessRenderPipelineManager class
|
|
|
+ * @see https://doc.babylonjs.com/how_to/how_to_use_postprocessrenderpipeline
|
|
|
+ */
|
|
|
var PostProcessRenderPipelineManager = /** @class */ (function () {
|
|
|
+ /**
|
|
|
+ * Initializes a PostProcessRenderPipelineManager
|
|
|
+ * @see https://doc.babylonjs.com/how_to/how_to_use_postprocessrenderpipeline
|
|
|
+ */
|
|
|
function PostProcessRenderPipelineManager() {
|
|
|
this._renderPipelines = {};
|
|
|
}
|
|
|
+ /**
|
|
|
+ * Adds a pipeline to the manager
|
|
|
+ * @param renderPipeline The pipeline to add
|
|
|
+ */
|
|
|
PostProcessRenderPipelineManager.prototype.addPipeline = function (renderPipeline) {
|
|
|
this._renderPipelines[renderPipeline._name] = renderPipeline;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Attaches a camera to the pipeline
|
|
|
+ * @param renderPipelineName The name of the pipeline to attach to
|
|
|
+ * @param cameras the camera to attach
|
|
|
+ * @param unique if the camera can be attached multiple times to the pipeline
|
|
|
+ */
|
|
|
PostProcessRenderPipelineManager.prototype.attachCamerasToRenderPipeline = function (renderPipelineName, cameras, unique) {
|
|
|
if (unique === void 0) { unique = false; }
|
|
|
var renderPipeline = this._renderPipelines[renderPipelineName];
|
|
@@ -82192,6 +82248,11 @@ var BABYLON;
|
|
|
}
|
|
|
renderPipeline._attachCameras(cameras, unique);
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Detaches a camera from the pipeline
|
|
|
+ * @param renderPipelineName The name of the pipeline to detach from
|
|
|
+ * @param cameras the camera to detach
|
|
|
+ */
|
|
|
PostProcessRenderPipelineManager.prototype.detachCamerasFromRenderPipeline = function (renderPipelineName, cameras) {
|
|
|
var renderPipeline = this._renderPipelines[renderPipelineName];
|
|
|
if (!renderPipeline) {
|
|
@@ -82199,6 +82260,12 @@ var BABYLON;
|
|
|
}
|
|
|
renderPipeline._detachCameras(cameras);
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Enables an effect by name on a pipeline
|
|
|
+ * @param renderPipelineName the name of the pipeline to enable the effect in
|
|
|
+ * @param renderEffectName the name of the effect to enable
|
|
|
+ * @param cameras the cameras that the effect should be enabled on
|
|
|
+ */
|
|
|
PostProcessRenderPipelineManager.prototype.enableEffectInPipeline = function (renderPipelineName, renderEffectName, cameras) {
|
|
|
var renderPipeline = this._renderPipelines[renderPipelineName];
|
|
|
if (!renderPipeline) {
|
|
@@ -82206,6 +82273,12 @@ var BABYLON;
|
|
|
}
|
|
|
renderPipeline._enableEffect(renderEffectName, cameras);
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Disables an effect by name on a pipeline
|
|
|
+ * @param renderPipelineName the name of the pipeline to disable the effect in
|
|
|
+ * @param renderEffectName the name of the effect to disable
|
|
|
+ * @param cameras the cameras that the effect should be disabled on
|
|
|
+ */
|
|
|
PostProcessRenderPipelineManager.prototype.disableEffectInPipeline = function (renderPipelineName, renderEffectName, cameras) {
|
|
|
var renderPipeline = this._renderPipelines[renderPipelineName];
|
|
|
if (!renderPipeline) {
|
|
@@ -82213,6 +82286,9 @@ var BABYLON;
|
|
|
}
|
|
|
renderPipeline._disableEffect(renderEffectName, cameras);
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Updates the state of all contained render pipelines and disposes of any non supported pipelines
|
|
|
+ */
|
|
|
PostProcessRenderPipelineManager.prototype.update = function () {
|
|
|
for (var renderPipelineName in this._renderPipelines) {
|
|
|
if (this._renderPipelines.hasOwnProperty(renderPipelineName)) {
|
|
@@ -82236,6 +82312,9 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Disposes of the manager and pipelines
|
|
|
+ */
|
|
|
PostProcessRenderPipelineManager.prototype.dispose = function () {
|
|
|
for (var renderPipelineName in this._renderPipelines) {
|
|
|
if (this._renderPipelines.hasOwnProperty(renderPipelineName)) {
|
|
@@ -82497,7 +82576,16 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * PostProcessRenderPipeline
|
|
|
+ * @see https://doc.babylonjs.com/how_to/how_to_use_postprocessrenderpipeline
|
|
|
+ */
|
|
|
var PostProcessRenderPipeline = /** @class */ (function () {
|
|
|
+ /**
|
|
|
+ * Initializes a PostProcessRenderPipeline
|
|
|
+ * @param engine engine to add the pipeline to
|
|
|
+ * @param name name of the pipeline
|
|
|
+ */
|
|
|
function PostProcessRenderPipeline(engine, name) {
|
|
|
this.engine = engine;
|
|
|
this._name = name;
|
|
@@ -82505,10 +82593,17 @@ var BABYLON;
|
|
|
this._renderEffectsForIsolatedPass = new Array();
|
|
|
this._cameras = [];
|
|
|
}
|
|
|
+ /**
|
|
|
+ * "PostProcessRenderPipeline"
|
|
|
+ * @returns "PostProcessRenderPipeline"
|
|
|
+ */
|
|
|
PostProcessRenderPipeline.prototype.getClassName = function () {
|
|
|
return "PostProcessRenderPipeline";
|
|
|
};
|
|
|
Object.defineProperty(PostProcessRenderPipeline.prototype, "isSupported", {
|
|
|
+ /**
|
|
|
+ * If all the render effects in the pipeline are support
|
|
|
+ */
|
|
|
get: function () {
|
|
|
for (var renderEffectName in this._renderEffects) {
|
|
|
if (this._renderEffects.hasOwnProperty(renderEffectName)) {
|
|
@@ -82522,6 +82617,10 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ /**
|
|
|
+ * Adds an effect to the pipeline
|
|
|
+ * @param renderEffect the effect to add
|
|
|
+ */
|
|
|
PostProcessRenderPipeline.prototype.addEffect = function (renderEffect) {
|
|
|
this._renderEffects[renderEffect._name] = renderEffect;
|
|
|
};
|
|
@@ -82537,6 +82636,7 @@ var BABYLON;
|
|
|
}
|
|
|
renderEffects._enable(BABYLON.Tools.MakeArray(cameras || this._cameras));
|
|
|
};
|
|
|
+ /** @hidden */
|
|
|
PostProcessRenderPipeline.prototype._disableEffect = function (renderEffectName, cameras) {
|
|
|
var renderEffects = this._renderEffects[renderEffectName];
|
|
|
if (!renderEffects) {
|
|
@@ -82617,6 +82717,9 @@ var BABYLON;
|
|
|
}
|
|
|
return false;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Disposes of the pipeline
|
|
|
+ */
|
|
|
PostProcessRenderPipeline.prototype.dispose = function () {
|
|
|
// Must be implemented by children
|
|
|
};
|
|
@@ -84084,9 +84187,15 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Standard rendering pipeline
|
|
|
+ * Default pipeline should be used going forward but the standard pipeline will be kept for backwards compatibility.
|
|
|
+ * @see https://doc.babylonjs.com/how_to/using_standard_rendering_pipeline
|
|
|
+ */
|
|
|
var StandardRenderingPipeline = /** @class */ (function (_super) {
|
|
|
__extends(StandardRenderingPipeline, _super);
|
|
|
/**
|
|
|
+ * Default pipeline should be used going forward but the standard pipeline will be kept for backwards compatibility.
|
|
|
* @constructor
|
|
|
* @param {string} name - The rendering pipeline name
|
|
|
* @param {BABYLON.Scene} scene - The scene linked to this pipeline
|
|
@@ -86141,10 +86250,12 @@ var BABYLON;
|
|
|
*/
|
|
|
_this.SharpenPostProcessId = "SharpenPostProcessEffect";
|
|
|
/**
|
|
|
+ * @ignore
|
|
|
* ID of the image processing post process;
|
|
|
*/
|
|
|
_this.ImageProcessingPostProcessId = "ImageProcessingPostProcessEffect";
|
|
|
/**
|
|
|
+ * @ignore
|
|
|
* ID of the Fast Approximate Anti-Aliasing post process;
|
|
|
*/
|
|
|
_this.FxaaPostProcessId = "FxaaPostProcessEffect";
|
|
@@ -88157,9 +88268,33 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Post process which applies a refractin texture
|
|
|
+ * @see https://doc.babylonjs.com/how_to/how_to_use_postprocesses#refraction
|
|
|
+ */
|
|
|
var RefractionPostProcess = /** @class */ (function (_super) {
|
|
|
__extends(RefractionPostProcess, _super);
|
|
|
- function RefractionPostProcess(name, refractionTextureUrl, color, depth, colorLevel, options, camera, samplingMode, engine, reusable) {
|
|
|
+ /**
|
|
|
+ * Initializes the RefractionPostProcess
|
|
|
+ * @see https://doc.babylonjs.com/how_to/how_to_use_postprocesses#refraction
|
|
|
+ * @param name The name of the effect.
|
|
|
+ * @param refractionTextureUrl Url of the refraction texture to use
|
|
|
+ * @param color the base color of the refraction (used to taint the rendering)
|
|
|
+ * @param depth simulated refraction depth
|
|
|
+ * @param colorLevel the coefficient of the base color (0 to remove base color tainting)
|
|
|
+ * @param camera The camera to apply the render pass to.
|
|
|
+ * @param options The required width/height ratio to downsize to before computing the render pass.
|
|
|
+ * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
|
|
|
+ * @param engine The engine which the post process will be applied. (default: current engine)
|
|
|
+ * @param reusable If the post process can be reused on the same frame. (default: false)
|
|
|
+ */
|
|
|
+ function RefractionPostProcess(name, refractionTextureUrl,
|
|
|
+ /** the base color of the refraction (used to taint the rendering) */
|
|
|
+ color,
|
|
|
+ /** simulated refraction depth */
|
|
|
+ depth,
|
|
|
+ /** the coefficient of the base color (0 to remove base color tainting) */
|
|
|
+ colorLevel, options, camera, samplingMode, engine, reusable) {
|
|
|
var _this = _super.call(this, name, "refraction", ["baseColor", "depth", "colorLevel"], ["refractionSampler"], options, camera, samplingMode, engine, reusable) || this;
|
|
|
_this.color = color;
|
|
|
_this.depth = depth;
|
|
@@ -88195,6 +88330,10 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
// Methods
|
|
|
+ /**
|
|
|
+ * Disposes of the post process
|
|
|
+ * @param camera Camera to dispose post process on
|
|
|
+ */
|
|
|
RefractionPostProcess.prototype.dispose = function (camera) {
|
|
|
if (this._refTexture && this._ownRefractionTexture) {
|
|
|
this._refTexture.dispose();
|
|
@@ -88212,10 +88351,26 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Post process used to render in black and white
|
|
|
+ */
|
|
|
var BlackAndWhitePostProcess = /** @class */ (function (_super) {
|
|
|
__extends(BlackAndWhitePostProcess, _super);
|
|
|
+ /**
|
|
|
+ * Creates a black and white post process
|
|
|
+ * @see https://doc.babylonjs.com/how_to/how_to_use_postprocesses#black-and-white
|
|
|
+ * @param name The name of the effect.
|
|
|
+ * @param options The required width/height ratio to downsize to before computing the render pass.
|
|
|
+ * @param camera The camera to apply the render pass to.
|
|
|
+ * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
|
|
|
+ * @param engine The engine which the post process will be applied. (default: current engine)
|
|
|
+ * @param reusable If the post process can be reused on the same frame. (default: false)
|
|
|
+ */
|
|
|
function BlackAndWhitePostProcess(name, options, camera, samplingMode, engine, reusable) {
|
|
|
var _this = _super.call(this, name, "blackAndWhite", ["degree"], null, options, camera, samplingMode, engine, reusable) || this;
|
|
|
+ /**
|
|
|
+ * Linear about to convert he result to black and white (default: 1)
|
|
|
+ */
|
|
|
_this.degree = 1;
|
|
|
_this.onApplyObservable.add(function (effect) {
|
|
|
effect.setFloat("degree", _this.degree);
|
|
@@ -88297,9 +88452,24 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Applies a kernel filter to the image
|
|
|
+ */
|
|
|
var FilterPostProcess = /** @class */ (function (_super) {
|
|
|
__extends(FilterPostProcess, _super);
|
|
|
- function FilterPostProcess(name, kernelMatrix, options, camera, samplingMode, engine, reusable) {
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param name The name of the effect.
|
|
|
+ * @param kernelMatrix The matrix to be applied to the image
|
|
|
+ * @param options The required width/height ratio to downsize to before computing the render pass.
|
|
|
+ * @param camera The camera to apply the render pass to.
|
|
|
+ * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
|
|
|
+ * @param engine The engine which the post process will be applied. (default: current engine)
|
|
|
+ * @param reusable If the post process can be reused on the same frame. (default: false)
|
|
|
+ */
|
|
|
+ function FilterPostProcess(name,
|
|
|
+ /** The matrix to be applied to the image */
|
|
|
+ kernelMatrix, options, camera, samplingMode, engine, reusable) {
|
|
|
var _this = _super.call(this, name, "filter", ["kernelMatrix"], null, options, camera, samplingMode, engine, reusable) || this;
|
|
|
_this.kernelMatrix = kernelMatrix;
|
|
|
_this.onApply = function (effect) {
|
|
@@ -88813,8 +88983,20 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * DisplayPassPostProcess which produces an output the same as it's input
|
|
|
+ */
|
|
|
var DisplayPassPostProcess = /** @class */ (function (_super) {
|
|
|
__extends(DisplayPassPostProcess, _super);
|
|
|
+ /**
|
|
|
+ * Creates the DisplayPassPostProcess
|
|
|
+ * @param name The name of the effect.
|
|
|
+ * @param options The required width/height ratio to downsize to before computing the render pass.
|
|
|
+ * @param camera The camera to apply the render pass to.
|
|
|
+ * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
|
|
|
+ * @param engine The engine which the post process will be applied. (default: current engine)
|
|
|
+ * @param reusable If the post process can be reused on the same frame. (default: false)
|
|
|
+ */
|
|
|
function DisplayPassPostProcess(name, options, camera, samplingMode, engine, reusable) {
|
|
|
return _super.call(this, name, "displayPass", ["passSampler"], ["passSampler"], options, camera, samplingMode, engine, reusable) || this;
|
|
|
}
|
|
@@ -88828,8 +89010,23 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Extracts highlights from the image
|
|
|
+ * @see https://doc.babylonjs.com/how_to/how_to_use_postprocesses
|
|
|
+ */
|
|
|
var HighlightsPostProcess = /** @class */ (function (_super) {
|
|
|
__extends(HighlightsPostProcess, _super);
|
|
|
+ /**
|
|
|
+ * Extracts highlights from the image
|
|
|
+ * @see https://doc.babylonjs.com/how_to/how_to_use_postprocesses
|
|
|
+ * @param name The name of the effect.
|
|
|
+ * @param options The required width/height ratio to downsize to before computing the render pass.
|
|
|
+ * @param camera The camera to apply the render pass to.
|
|
|
+ * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
|
|
|
+ * @param engine The engine which the post process will be applied. (default: current engine)
|
|
|
+ * @param reusable If the post process can be reused on the same frame. (default: false)
|
|
|
+ * @param textureType Type of texture for the post process (default: Engine.TEXTURETYPE_UNSIGNED_INT)
|
|
|
+ */
|
|
|
function HighlightsPostProcess(name, options, camera, samplingMode, engine, reusable, textureType) {
|
|
|
if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
|
|
|
return _super.call(this, name, "highlights", null, null, options, camera, samplingMode, engine, reusable, null, textureType) || this;
|
|
@@ -88849,6 +89046,10 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * ImageProcessingPostProcess
|
|
|
+ * @see https://doc.babylonjs.com/how_to/how_to_use_postprocesses#imageprocessing
|
|
|
+ */
|
|
|
var ImageProcessingPostProcess = /** @class */ (function (_super) {
|
|
|
__extends(ImageProcessingPostProcess, _super);
|
|
|
function ImageProcessingPostProcess(name, options, camera, samplingMode, engine, reusable, textureType, imageProcessingConfiguration) {
|
|
@@ -89221,6 +89422,10 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ /**
|
|
|
+ * "ImageProcessingPostProcess"
|
|
|
+ * @returns "ImageProcessingPostProcess"
|
|
|
+ */
|
|
|
ImageProcessingPostProcess.prototype.getClassName = function () {
|
|
|
return "ImageProcessingPostProcess";
|
|
|
};
|
|
@@ -101321,25 +101526,57 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Octrees are a really powerful data structure that can quickly select entities based on space coordinates.
|
|
|
+ * @see https://doc.babylonjs.com/how_to/optimizing_your_scene_with_octrees
|
|
|
+ */
|
|
|
var Octree = /** @class */ (function () {
|
|
|
- function Octree(creationFunc, maxBlockCapacity, maxDepth) {
|
|
|
+ /**
|
|
|
+ * Creates a octree
|
|
|
+ * @see https://doc.babylonjs.com/how_to/optimizing_your_scene_with_octrees
|
|
|
+ * @param creationFunc function to be used to instatiate the octree
|
|
|
+ * @param maxBlockCapacity defines the maximum number of meshes you want on your octree's leaves (default: 64)
|
|
|
+ * @param maxDepth defines the maximum depth (sub-levels) for your octree. Default value is 2, which means 8 8 8 = 512 blocks :) (This parameter takes precedence over capacity.)
|
|
|
+ */
|
|
|
+ function Octree(creationFunc, maxBlockCapacity,
|
|
|
+ /** Defines the maximum depth (sub-levels) for your octree. Default value is 2, which means 8 8 8 = 512 blocks :) (This parameter takes precedence over capacity.) */
|
|
|
+ maxDepth) {
|
|
|
if (maxDepth === void 0) { maxDepth = 2; }
|
|
|
this.maxDepth = maxDepth;
|
|
|
+ /**
|
|
|
+ * Content stored in the octree
|
|
|
+ */
|
|
|
this.dynamicContent = new Array();
|
|
|
this._maxBlockCapacity = maxBlockCapacity || 64;
|
|
|
this._selectionContent = new BABYLON.SmartArrayNoDuplicate(1024);
|
|
|
this._creationFunc = creationFunc;
|
|
|
}
|
|
|
// Methods
|
|
|
+ /**
|
|
|
+ * Updates the octree by adding blocks for the passed in meshes within the min and max world parameters
|
|
|
+ * @param worldMin worldMin for the octree blocks var blockSize = new Vector3((worldMax.x - worldMin.x) / 2, (worldMax.y - worldMin.y) / 2, (worldMax.z - worldMin.z) / 2);
|
|
|
+ * @param worldMax worldMax for the octree blocks var blockSize = new Vector3((worldMax.x - worldMin.x) / 2, (worldMax.y - worldMin.y) / 2, (worldMax.z - worldMin.z) / 2);
|
|
|
+ * @param entries meshes to be added to the octree blocks
|
|
|
+ */
|
|
|
Octree.prototype.update = function (worldMin, worldMax, entries) {
|
|
|
Octree._CreateBlocks(worldMin, worldMax, entries, this._maxBlockCapacity, 0, this.maxDepth, this, this._creationFunc);
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Adds a mesh to the octree
|
|
|
+ * @param entry Mesh to add to the octree
|
|
|
+ */
|
|
|
Octree.prototype.addMesh = function (entry) {
|
|
|
for (var index = 0; index < this.blocks.length; index++) {
|
|
|
var block = this.blocks[index];
|
|
|
block.addEntry(entry);
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Selects an array of meshes within the frustum
|
|
|
+ * @param frustumPlanes The frustum planes to use which will select all meshes within it
|
|
|
+ * @param allowDuplicate If duplicate objects are allowed in the resulting object array
|
|
|
+ * @returns array of meshes within the frustum
|
|
|
+ */
|
|
|
Octree.prototype.select = function (frustumPlanes, allowDuplicate) {
|
|
|
this._selectionContent.reset();
|
|
|
for (var index = 0; index < this.blocks.length; index++) {
|
|
@@ -101354,6 +101591,13 @@ var BABYLON;
|
|
|
}
|
|
|
return this._selectionContent;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Test if the octree intersect with the given bounding sphere and if yes, then add its content to the selection array
|
|
|
+ * @param sphereCenter defines the bounding sphere center
|
|
|
+ * @param sphereRadius defines the bounding sphere radius
|
|
|
+ * @param allowDuplicate defines if the selection array can contains duplicated entries
|
|
|
+ * @returns an array of objects that intersect the sphere
|
|
|
+ */
|
|
|
Octree.prototype.intersects = function (sphereCenter, sphereRadius, allowDuplicate) {
|
|
|
this._selectionContent.reset();
|
|
|
for (var index = 0; index < this.blocks.length; index++) {
|
|
@@ -101368,6 +101612,11 @@ var BABYLON;
|
|
|
}
|
|
|
return this._selectionContent;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Test if the octree intersect with the given ray and if yes, then add its content to resulting array
|
|
|
+ * @param ray defines the ray to test with
|
|
|
+ * @returns array of intersected objects
|
|
|
+ */
|
|
|
Octree.prototype.intersectsRay = function (ray) {
|
|
|
this._selectionContent.reset();
|
|
|
for (var index = 0; index < this.blocks.length; index++) {
|
|
@@ -101377,6 +101626,9 @@ var BABYLON;
|
|
|
this._selectionContent.concatWithNoDuplicate(this.dynamicContent);
|
|
|
return this._selectionContent;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
Octree._CreateBlocks = function (worldMin, worldMax, entries, maxBlockCapacity, currentDepth, maxDepth, target, creationFunc) {
|
|
|
target.blocks = new Array();
|
|
|
var blockSize = new BABYLON.Vector3((worldMax.x - worldMin.x) / 2, (worldMax.y - worldMin.y) / 2, (worldMax.z - worldMin.z) / 2);
|
|
@@ -101393,12 +101645,18 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Adds a mesh into the octree block if it intersects the block
|
|
|
+ */
|
|
|
Octree.CreationFuncForMeshes = function (entry, block) {
|
|
|
var boundingInfo = entry.getBoundingInfo();
|
|
|
if (!entry.isBlocked && boundingInfo.boundingBox.intersectsMinMax(block.minPoint, block.maxPoint)) {
|
|
|
block.entries.push(entry);
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Adds a submesh into the octree block if it intersects the block
|
|
|
+ */
|
|
|
Octree.CreationFuncForSubMeshes = function (entry, block) {
|
|
|
var boundingInfo = entry.getBoundingInfo();
|
|
|
if (boundingInfo.boundingBox.intersectsMinMax(block.minPoint, block.maxPoint)) {
|
|
@@ -101955,8 +102213,20 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * StereoscopicInterlacePostProcess used to render stereo views from a rigged camera
|
|
|
+ */
|
|
|
var StereoscopicInterlacePostProcess = /** @class */ (function (_super) {
|
|
|
__extends(StereoscopicInterlacePostProcess, _super);
|
|
|
+ /**
|
|
|
+ * Initializes a StereoscopicInterlacePostProcess
|
|
|
+ * @param name The name of the effect.
|
|
|
+ * @param rigCameras The rig cameras to be appled to the post process
|
|
|
+ * @param isStereoscopicHoriz If the rendered results are horizontal or verticle
|
|
|
+ * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
|
|
|
+ * @param engine The engine which the post process will be applied. (default: current engine)
|
|
|
+ * @param reusable If the post process can be reused on the same frame. (default: false)
|
|
|
+ */
|
|
|
function StereoscopicInterlacePostProcess(name, rigCameras, isStereoscopicHoriz, samplingMode, engine, reusable) {
|
|
|
var _this = _super.call(this, name, "stereoscopicInterlace", ['stepSize'], ['camASampler'], 1, rigCameras[1], samplingMode, engine, reusable, isStereoscopicHoriz ? "#define IS_STEREOSCOPIC_HORIZ 1" : undefined) || this;
|
|
|
_this._passedProcess = rigCameras[0]._rigPostProcess;
|
|
@@ -102147,8 +102417,18 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * VRDistortionCorrectionPostProcess used for mobile VR
|
|
|
+ */
|
|
|
var VRDistortionCorrectionPostProcess = /** @class */ (function (_super) {
|
|
|
__extends(VRDistortionCorrectionPostProcess, _super);
|
|
|
+ /**
|
|
|
+ * Initializes the VRDistortionCorrectionPostProcess
|
|
|
+ * @param name The name of the effect.
|
|
|
+ * @param camera The camera to apply the render pass to.
|
|
|
+ * @param isRightEye If this is for the right eye distortion
|
|
|
+ * @param vrMetrics All the required metrics for the VR camera
|
|
|
+ */
|
|
|
function VRDistortionCorrectionPostProcess(name, camera, isRightEye, vrMetrics) {
|
|
|
var _this = _super.call(this, name, "vrDistortionCorrection", [
|
|
|
'LensCenter',
|
|
@@ -115049,7 +115329,8 @@ var BABYLON;
|
|
|
/**
|
|
|
* Static function used to export a particle system to a ParticleSystemSet variable.
|
|
|
* Please note that the emitter shape is not exported
|
|
|
- * @param system defines the particle systems to export
|
|
|
+ * @param systems defines the particle systems to export
|
|
|
+ * @returns the created particle system set
|
|
|
*/
|
|
|
ParticleHelper.ExportSet = function (systems) {
|
|
|
var set = new BABYLON.ParticleSystemSet();
|