|
@@ -12709,6 +12709,7 @@ var BABYLON;
|
|
|
*/
|
|
|
Engine.prototype.clear = function (color, backBuffer, depth, stencil) {
|
|
|
if (stencil === void 0) { stencil = false; }
|
|
|
+ this.applyStates();
|
|
|
var mode = 0;
|
|
|
if (backBuffer && color) {
|
|
|
this._gl.clearColor(color.r, color.g, color.b, color.a !== undefined ? color.a : 1.0);
|
|
@@ -92272,6 +92273,7 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /** @hidden */
|
|
|
var CannonJSPlugin = /** @class */ (function () {
|
|
|
function CannonJSPlugin(_useDeltaForWorldStep, iterations) {
|
|
|
if (_useDeltaForWorldStep === void 0) { _useDeltaForWorldStep = true; }
|
|
@@ -92836,6 +92838,7 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /** @hidden */
|
|
|
var OimoJSPlugin = /** @class */ (function () {
|
|
|
function OimoJSPlugin(iterations) {
|
|
|
this.name = "OimoJSPlugin";
|
|
@@ -98492,8 +98495,24 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Class used to store a cell in an octree
|
|
|
+ * @see http://doc.babylonjs.com/how_to/optimizing_your_scene_with_octrees
|
|
|
+ */
|
|
|
var OctreeBlock = /** @class */ (function () {
|
|
|
+ /**
|
|
|
+ * Creates a new block
|
|
|
+ * @param minPoint defines the minimum vector (in world space) of the block's bounding box
|
|
|
+ * @param maxPoint defines the maximum vector (in world space) of the block's bounding box
|
|
|
+ * @param capacity defines the maximum capacity of this block (if capacity is reached the block will be split into sub blocks)
|
|
|
+ * @param depth defines the current depth of this block in the octree
|
|
|
+ * @param maxDepth defines the maximal depth allowed (beyond this value, the capacity is ignored)
|
|
|
+ * @param creationFunc defines a callback to call when an element is added to the block
|
|
|
+ */
|
|
|
function OctreeBlock(minPoint, maxPoint, capacity, depth, maxDepth, creationFunc) {
|
|
|
+ /**
|
|
|
+ * Gets the content of the current block
|
|
|
+ */
|
|
|
this.entries = new Array();
|
|
|
this._boundingVectors = new Array();
|
|
|
this._capacity = capacity;
|
|
@@ -98519,6 +98538,9 @@ var BABYLON;
|
|
|
}
|
|
|
Object.defineProperty(OctreeBlock.prototype, "capacity", {
|
|
|
// Property
|
|
|
+ /**
|
|
|
+ * Gets the maximum capacity of this block (if capacity is reached the block will be split into sub blocks)
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._capacity;
|
|
|
},
|
|
@@ -98526,6 +98548,9 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(OctreeBlock.prototype, "minPoint", {
|
|
|
+ /**
|
|
|
+ * Gets the minimum vector (in world space) of the block's bounding box
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._minPoint;
|
|
|
},
|
|
@@ -98533,6 +98558,9 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(OctreeBlock.prototype, "maxPoint", {
|
|
|
+ /**
|
|
|
+ * Gets the maximum vector (in world space) of the block's bounding box
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._maxPoint;
|
|
|
},
|
|
@@ -98540,6 +98568,10 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
// Methods
|
|
|
+ /**
|
|
|
+ * Add a new element to this block
|
|
|
+ * @param entry defines the element to add
|
|
|
+ */
|
|
|
OctreeBlock.prototype.addEntry = function (entry) {
|
|
|
if (this.blocks) {
|
|
|
for (var index = 0; index < this.blocks.length; index++) {
|
|
@@ -98553,12 +98585,22 @@ var BABYLON;
|
|
|
this.createInnerBlocks();
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Add an array of elements to this block
|
|
|
+ * @param entries defines the array of elements to add
|
|
|
+ */
|
|
|
OctreeBlock.prototype.addEntries = function (entries) {
|
|
|
for (var index = 0; index < entries.length; index++) {
|
|
|
var mesh = entries[index];
|
|
|
this.addEntry(mesh);
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Test if the current block intersects the furstum planes and if yes, then add its content to the selection array
|
|
|
+ * @param frustumPlanes defines the frustum planes to test
|
|
|
+ * @param selection defines the array to store current content if selection is positive
|
|
|
+ * @param allowDuplicate defines if the selection array can contains duplicated entries
|
|
|
+ */
|
|
|
OctreeBlock.prototype.select = function (frustumPlanes, selection, allowDuplicate) {
|
|
|
if (BABYLON.BoundingBox.IsInFrustum(this._boundingVectors, frustumPlanes)) {
|
|
|
if (this.blocks) {
|
|
@@ -98576,6 +98618,13 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Test if the current block 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 selection defines the array to store current content if selection is positive
|
|
|
+ * @param allowDuplicate defines if the selection array can contains duplicated entries
|
|
|
+ */
|
|
|
OctreeBlock.prototype.intersects = function (sphereCenter, sphereRadius, selection, allowDuplicate) {
|
|
|
if (BABYLON.BoundingBox.IntersectsSphere(this._minPoint, this._maxPoint, sphereCenter, sphereRadius)) {
|
|
|
if (this.blocks) {
|
|
@@ -98593,6 +98642,11 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Test if the current block intersect with the given ray and if yes, then add its content to the selection array
|
|
|
+ * @param ray defines the ray to test with
|
|
|
+ * @param selection defines the array to store current content if selection is positive
|
|
|
+ */
|
|
|
OctreeBlock.prototype.intersectsRay = function (ray, selection) {
|
|
|
if (ray.intersectsBoxMinMax(this._minPoint, this._maxPoint)) {
|
|
|
if (this.blocks) {
|
|
@@ -98605,6 +98659,9 @@ var BABYLON;
|
|
|
selection.concatWithNoDuplicate(this.entries);
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Subdivide the content into child blocks (this block will then be empty)
|
|
|
+ */
|
|
|
OctreeBlock.prototype.createInnerBlocks = function () {
|
|
|
BABYLON.Octree._CreateBlocks(this._minPoint, this._maxPoint, this.entries, this._capacity, this._depth, this._maxDepth, this, this._creationFunc);
|
|
|
};
|