|
@@ -19864,6 +19864,26 @@ var BABYLON;
|
|
|
}
|
|
|
return _OcclusionDataStorage;
|
|
|
}());
|
|
|
+ /** @hidden */
|
|
|
+ var _FacetDataStorage = /** @class */ (function () {
|
|
|
+ function _FacetDataStorage() {
|
|
|
+ this.facetNb = 0; // facet number
|
|
|
+ this.partitioningSubdivisions = 10; // number of subdivisions per axis in the partioning space
|
|
|
+ this.partitioningBBoxRatio = 1.01; // the partioning array space is by default 1% bigger than the bounding box
|
|
|
+ this.facetDataEnabled = false; // is the facet data feature enabled on this mesh ?
|
|
|
+ this.facetParameters = {}; // keep a reference to the object parameters to avoid memory re-allocation
|
|
|
+ this.bbSize = BABYLON.Vector3.Zero(); // bbox size approximated for facet data
|
|
|
+ this.subDiv = {
|
|
|
+ max: 1,
|
|
|
+ X: 1,
|
|
|
+ Y: 1,
|
|
|
+ Z: 1
|
|
|
+ };
|
|
|
+ this.facetDepthSort = false; // is the facet depth sort to be computed
|
|
|
+ this.facetDepthSortEnabled = false; // is the facet depth sort initialized
|
|
|
+ }
|
|
|
+ return _FacetDataStorage;
|
|
|
+ }());
|
|
|
/**
|
|
|
* Class used to store all common mesh properties
|
|
|
*/
|
|
@@ -19878,20 +19898,7 @@ var BABYLON;
|
|
|
function AbstractMesh(name, scene) {
|
|
|
if (scene === void 0) { scene = null; }
|
|
|
var _this = _super.call(this, name, scene, false) || this;
|
|
|
- _this._facetNb = 0; // facet number
|
|
|
- _this._partitioningSubdivisions = 10; // number of subdivisions per axis in the partioning space
|
|
|
- _this._partitioningBBoxRatio = 1.01; // the partioning array space is by default 1% bigger than the bounding box
|
|
|
- _this._facetDataEnabled = false; // is the facet data feature enabled on this mesh ?
|
|
|
- _this._facetParameters = {}; // keep a reference to the object parameters to avoid memory re-allocation
|
|
|
- _this._bbSize = BABYLON.Vector3.Zero(); // bbox size approximated for facet data
|
|
|
- _this._subDiv = {
|
|
|
- max: 1,
|
|
|
- X: 1,
|
|
|
- Y: 1,
|
|
|
- Z: 1
|
|
|
- };
|
|
|
- _this._facetDepthSort = false; // is the facet depth sort to be computed
|
|
|
- _this._facetDepthSortEnabled = false; // is the facet depth sort initialized
|
|
|
+ _this._facetData = new _FacetDataStorage();
|
|
|
/** Gets ot sets the culling strategy to use to find visible meshes */
|
|
|
_this.cullingStrategy = AbstractMesh.CULLINGSTRATEGY_STANDARD;
|
|
|
// Events
|
|
@@ -20099,7 +20106,7 @@ var BABYLON;
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#what-is-a-mesh-facet
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return this._facetNb;
|
|
|
+ return this._facetData.facetNb;
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -20110,10 +20117,10 @@ var BABYLON;
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#tweaking-the-partitioning
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return this._partitioningSubdivisions;
|
|
|
+ return this._facetData.partitioningSubdivisions;
|
|
|
},
|
|
|
set: function (nb) {
|
|
|
- this._partitioningSubdivisions = nb;
|
|
|
+ this._facetData.partitioningSubdivisions = nb;
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -20125,10 +20132,10 @@ var BABYLON;
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#tweaking-the-partitioning
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return this._partitioningBBoxRatio;
|
|
|
+ return this._facetData.partitioningBBoxRatio;
|
|
|
},
|
|
|
set: function (ratio) {
|
|
|
- this._partitioningBBoxRatio = ratio;
|
|
|
+ this._facetData.partitioningBBoxRatio = ratio;
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -20141,10 +20148,10 @@ var BABYLON;
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#facet-depth-sort
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return this._facetDepthSort;
|
|
|
+ return this._facetData.facetDepthSort;
|
|
|
},
|
|
|
set: function (sort) {
|
|
|
- this._facetDepthSort = sort;
|
|
|
+ this._facetData.facetDepthSort = sort;
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -20157,10 +20164,10 @@ var BABYLON;
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#facet-depth-sort
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return this._facetDepthSortFrom;
|
|
|
+ return this._facetData.facetDepthSortFrom;
|
|
|
},
|
|
|
set: function (location) {
|
|
|
- this._facetDepthSortFrom = location;
|
|
|
+ this._facetData.facetDepthSortFrom = location;
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -20171,7 +20178,7 @@ var BABYLON;
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#what-is-a-mesh-facet
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return this._facetDataEnabled;
|
|
|
+ return this._facetData.facetDataEnabled;
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -21233,7 +21240,7 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
// facet data
|
|
|
- if (this._facetDataEnabled) {
|
|
|
+ if (this._facetData.facetDataEnabled) {
|
|
|
this.disableFacetData();
|
|
|
}
|
|
|
this.onAfterWorldMatrixUpdateObservable.clear();
|
|
@@ -21263,23 +21270,24 @@ var BABYLON;
|
|
|
// Facet data
|
|
|
/** @hidden */
|
|
|
AbstractMesh.prototype._initFacetData = function () {
|
|
|
- if (!this._facetNormals) {
|
|
|
- this._facetNormals = new Array();
|
|
|
+ var data = this._facetData;
|
|
|
+ if (!data.facetNormals) {
|
|
|
+ data.facetNormals = new Array();
|
|
|
}
|
|
|
- if (!this._facetPositions) {
|
|
|
- this._facetPositions = new Array();
|
|
|
+ if (!data.facetPositions) {
|
|
|
+ data.facetPositions = new Array();
|
|
|
}
|
|
|
- if (!this._facetPartitioning) {
|
|
|
- this._facetPartitioning = new Array();
|
|
|
+ if (!data.facetPartitioning) {
|
|
|
+ data.facetPartitioning = new Array();
|
|
|
}
|
|
|
- this._facetNb = (this.getIndices().length / 3) | 0;
|
|
|
- this._partitioningSubdivisions = (this._partitioningSubdivisions) ? this._partitioningSubdivisions : 10; // default nb of partitioning subdivisions = 10
|
|
|
- this._partitioningBBoxRatio = (this._partitioningBBoxRatio) ? this._partitioningBBoxRatio : 1.01; // default ratio 1.01 = the partitioning is 1% bigger than the bounding box
|
|
|
- for (var f = 0; f < this._facetNb; f++) {
|
|
|
- this._facetNormals[f] = BABYLON.Vector3.Zero();
|
|
|
- this._facetPositions[f] = BABYLON.Vector3.Zero();
|
|
|
+ data.facetNb = (this.getIndices().length / 3) | 0;
|
|
|
+ data.partitioningSubdivisions = (data.partitioningSubdivisions) ? data.partitioningSubdivisions : 10; // default nb of partitioning subdivisions = 10
|
|
|
+ data.partitioningBBoxRatio = (data.partitioningBBoxRatio) ? data.partitioningBBoxRatio : 1.01; // default ratio 1.01 = the partitioning is 1% bigger than the bounding box
|
|
|
+ for (var f = 0; f < data.facetNb; f++) {
|
|
|
+ data.facetNormals[f] = BABYLON.Vector3.Zero();
|
|
|
+ data.facetPositions[f] = BABYLON.Vector3.Zero();
|
|
|
}
|
|
|
- this._facetDataEnabled = true;
|
|
|
+ data.facetDataEnabled = true;
|
|
|
return this;
|
|
|
};
|
|
|
/**
|
|
@@ -21290,21 +21298,22 @@ var BABYLON;
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_facetdata
|
|
|
*/
|
|
|
AbstractMesh.prototype.updateFacetData = function () {
|
|
|
- if (!this._facetDataEnabled) {
|
|
|
+ var data = this._facetData;
|
|
|
+ if (!data.facetDataEnabled) {
|
|
|
this._initFacetData();
|
|
|
}
|
|
|
var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
|
|
|
var indices = this.getIndices();
|
|
|
var normals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind);
|
|
|
var bInfo = this.getBoundingInfo();
|
|
|
- if (this._facetDepthSort && !this._facetDepthSortEnabled) {
|
|
|
+ if (data.facetDepthSort && !data.facetDepthSortEnabled) {
|
|
|
// init arrays, matrix and sort function on first call
|
|
|
- this._facetDepthSortEnabled = true;
|
|
|
+ data.facetDepthSortEnabled = true;
|
|
|
if (indices instanceof Uint16Array) {
|
|
|
- this._depthSortedIndices = new Uint16Array(indices);
|
|
|
+ data.depthSortedIndices = new Uint16Array(indices);
|
|
|
}
|
|
|
else if (indices instanceof Uint32Array) {
|
|
|
- this._depthSortedIndices = new Uint32Array(indices);
|
|
|
+ data.depthSortedIndices = new Uint32Array(indices);
|
|
|
}
|
|
|
else {
|
|
|
var needs32bits = false;
|
|
@@ -21315,66 +21324,66 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
if (needs32bits) {
|
|
|
- this._depthSortedIndices = new Uint32Array(indices);
|
|
|
+ data.depthSortedIndices = new Uint32Array(indices);
|
|
|
}
|
|
|
else {
|
|
|
- this._depthSortedIndices = new Uint16Array(indices);
|
|
|
+ data.depthSortedIndices = new Uint16Array(indices);
|
|
|
}
|
|
|
}
|
|
|
- this._facetDepthSortFunction = function (f1, f2) {
|
|
|
+ data.facetDepthSortFunction = function (f1, f2) {
|
|
|
return (f2.sqDistance - f1.sqDistance);
|
|
|
};
|
|
|
- if (!this._facetDepthSortFrom) {
|
|
|
+ if (!data.facetDepthSortFrom) {
|
|
|
var camera = this.getScene().activeCamera;
|
|
|
- this._facetDepthSortFrom = (camera) ? camera.position : BABYLON.Vector3.Zero();
|
|
|
+ data.facetDepthSortFrom = (camera) ? camera.position : BABYLON.Vector3.Zero();
|
|
|
}
|
|
|
- this._depthSortedFacets = [];
|
|
|
- for (var f = 0; f < this._facetNb; f++) {
|
|
|
+ data.depthSortedFacets = [];
|
|
|
+ for (var f = 0; f < data.facetNb; f++) {
|
|
|
var depthSortedFacet = { ind: f * 3, sqDistance: 0.0 };
|
|
|
- this._depthSortedFacets.push(depthSortedFacet);
|
|
|
- }
|
|
|
- this._invertedMatrix = BABYLON.Matrix.Identity();
|
|
|
- this._facetDepthSortOrigin = BABYLON.Vector3.Zero();
|
|
|
- }
|
|
|
- this._bbSize.x = (bInfo.maximum.x - bInfo.minimum.x > BABYLON.Epsilon) ? bInfo.maximum.x - bInfo.minimum.x : BABYLON.Epsilon;
|
|
|
- this._bbSize.y = (bInfo.maximum.y - bInfo.minimum.y > BABYLON.Epsilon) ? bInfo.maximum.y - bInfo.minimum.y : BABYLON.Epsilon;
|
|
|
- this._bbSize.z = (bInfo.maximum.z - bInfo.minimum.z > BABYLON.Epsilon) ? bInfo.maximum.z - bInfo.minimum.z : BABYLON.Epsilon;
|
|
|
- var bbSizeMax = (this._bbSize.x > this._bbSize.y) ? this._bbSize.x : this._bbSize.y;
|
|
|
- bbSizeMax = (bbSizeMax > this._bbSize.z) ? bbSizeMax : this._bbSize.z;
|
|
|
- this._subDiv.max = this._partitioningSubdivisions;
|
|
|
- this._subDiv.X = Math.floor(this._subDiv.max * this._bbSize.x / bbSizeMax); // adjust the number of subdivisions per axis
|
|
|
- this._subDiv.Y = Math.floor(this._subDiv.max * this._bbSize.y / bbSizeMax); // according to each bbox size per axis
|
|
|
- this._subDiv.Z = Math.floor(this._subDiv.max * this._bbSize.z / bbSizeMax);
|
|
|
- this._subDiv.X = this._subDiv.X < 1 ? 1 : this._subDiv.X; // at least one subdivision
|
|
|
- this._subDiv.Y = this._subDiv.Y < 1 ? 1 : this._subDiv.Y;
|
|
|
- this._subDiv.Z = this._subDiv.Z < 1 ? 1 : this._subDiv.Z;
|
|
|
+ data.depthSortedFacets.push(depthSortedFacet);
|
|
|
+ }
|
|
|
+ data.invertedMatrix = BABYLON.Matrix.Identity();
|
|
|
+ data.facetDepthSortOrigin = BABYLON.Vector3.Zero();
|
|
|
+ }
|
|
|
+ data.bbSize.x = (bInfo.maximum.x - bInfo.minimum.x > BABYLON.Epsilon) ? bInfo.maximum.x - bInfo.minimum.x : BABYLON.Epsilon;
|
|
|
+ data.bbSize.y = (bInfo.maximum.y - bInfo.minimum.y > BABYLON.Epsilon) ? bInfo.maximum.y - bInfo.minimum.y : BABYLON.Epsilon;
|
|
|
+ data.bbSize.z = (bInfo.maximum.z - bInfo.minimum.z > BABYLON.Epsilon) ? bInfo.maximum.z - bInfo.minimum.z : BABYLON.Epsilon;
|
|
|
+ var bbSizeMax = (data.bbSize.x > data.bbSize.y) ? data.bbSize.x : data.bbSize.y;
|
|
|
+ bbSizeMax = (bbSizeMax > data.bbSize.z) ? bbSizeMax : data.bbSize.z;
|
|
|
+ data.subDiv.max = data.partitioningSubdivisions;
|
|
|
+ data.subDiv.X = Math.floor(data.subDiv.max * data.bbSize.x / bbSizeMax); // adjust the number of subdivisions per axis
|
|
|
+ data.subDiv.Y = Math.floor(data.subDiv.max * data.bbSize.y / bbSizeMax); // according to each bbox size per axis
|
|
|
+ data.subDiv.Z = Math.floor(data.subDiv.max * data.bbSize.z / bbSizeMax);
|
|
|
+ data.subDiv.X = data.subDiv.X < 1 ? 1 : data.subDiv.X; // at least one subdivision
|
|
|
+ data.subDiv.Y = data.subDiv.Y < 1 ? 1 : data.subDiv.Y;
|
|
|
+ data.subDiv.Z = data.subDiv.Z < 1 ? 1 : data.subDiv.Z;
|
|
|
// set the parameters for ComputeNormals()
|
|
|
- this._facetParameters.facetNormals = this.getFacetLocalNormals();
|
|
|
- this._facetParameters.facetPositions = this.getFacetLocalPositions();
|
|
|
- this._facetParameters.facetPartitioning = this.getFacetLocalPartitioning();
|
|
|
- this._facetParameters.bInfo = bInfo;
|
|
|
- this._facetParameters.bbSize = this._bbSize;
|
|
|
- this._facetParameters.subDiv = this._subDiv;
|
|
|
- this._facetParameters.ratio = this.partitioningBBoxRatio;
|
|
|
- this._facetParameters.depthSort = this._facetDepthSort;
|
|
|
- if (this._facetDepthSort && this._facetDepthSortEnabled) {
|
|
|
+ data.facetParameters.facetNormals = this.getFacetLocalNormals();
|
|
|
+ data.facetParameters.facetPositions = this.getFacetLocalPositions();
|
|
|
+ data.facetParameters.facetPartitioning = this.getFacetLocalPartitioning();
|
|
|
+ data.facetParameters.bInfo = bInfo;
|
|
|
+ data.facetParameters.bbSize = data.bbSize;
|
|
|
+ data.facetParameters.subDiv = data.subDiv;
|
|
|
+ data.facetParameters.ratio = this.partitioningBBoxRatio;
|
|
|
+ data.facetParameters.depthSort = data.facetDepthSort;
|
|
|
+ if (data.facetDepthSort && data.facetDepthSortEnabled) {
|
|
|
this.computeWorldMatrix(true);
|
|
|
- this._worldMatrix.invertToRef(this._invertedMatrix);
|
|
|
- BABYLON.Vector3.TransformCoordinatesToRef(this._facetDepthSortFrom, this._invertedMatrix, this._facetDepthSortOrigin);
|
|
|
- this._facetParameters.distanceTo = this._facetDepthSortOrigin;
|
|
|
- }
|
|
|
- this._facetParameters.depthSortedFacets = this._depthSortedFacets;
|
|
|
- BABYLON.VertexData.ComputeNormals(positions, indices, normals, this._facetParameters);
|
|
|
- if (this._facetDepthSort && this._facetDepthSortEnabled) {
|
|
|
- this._depthSortedFacets.sort(this._facetDepthSortFunction);
|
|
|
- var l = (this._depthSortedIndices.length / 3) | 0;
|
|
|
+ this._worldMatrix.invertToRef(data.invertedMatrix);
|
|
|
+ BABYLON.Vector3.TransformCoordinatesToRef(data.facetDepthSortFrom, data.invertedMatrix, data.facetDepthSortOrigin);
|
|
|
+ data.facetParameters.distanceTo = data.facetDepthSortOrigin;
|
|
|
+ }
|
|
|
+ data.facetParameters.depthSortedFacets = data.depthSortedFacets;
|
|
|
+ BABYLON.VertexData.ComputeNormals(positions, indices, normals, data.facetParameters);
|
|
|
+ if (data.facetDepthSort && data.facetDepthSortEnabled) {
|
|
|
+ data.depthSortedFacets.sort(data.facetDepthSortFunction);
|
|
|
+ var l = (data.depthSortedIndices.length / 3) | 0;
|
|
|
for (var f = 0; f < l; f++) {
|
|
|
- var sind = this._depthSortedFacets[f].ind;
|
|
|
- this._depthSortedIndices[f * 3] = indices[sind];
|
|
|
- this._depthSortedIndices[f * 3 + 1] = indices[sind + 1];
|
|
|
- this._depthSortedIndices[f * 3 + 2] = indices[sind + 2];
|
|
|
+ var sind = data.depthSortedFacets[f].ind;
|
|
|
+ data.depthSortedIndices[f * 3] = indices[sind];
|
|
|
+ data.depthSortedIndices[f * 3 + 1] = indices[sind + 1];
|
|
|
+ data.depthSortedIndices[f * 3 + 2] = indices[sind + 2];
|
|
|
}
|
|
|
- this.updateIndices(this._depthSortedIndices);
|
|
|
+ this.updateIndices(data.depthSortedIndices);
|
|
|
}
|
|
|
return this;
|
|
|
};
|
|
@@ -21385,10 +21394,10 @@ var BABYLON;
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_facetdata
|
|
|
*/
|
|
|
AbstractMesh.prototype.getFacetLocalNormals = function () {
|
|
|
- if (!this._facetNormals) {
|
|
|
+ if (!this._facetData.facetNormals) {
|
|
|
this.updateFacetData();
|
|
|
}
|
|
|
- return this._facetNormals;
|
|
|
+ return this._facetData.facetNormals;
|
|
|
};
|
|
|
/**
|
|
|
* Returns the facetLocalPositions array.
|
|
@@ -21397,10 +21406,10 @@ var BABYLON;
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_facetdata
|
|
|
*/
|
|
|
AbstractMesh.prototype.getFacetLocalPositions = function () {
|
|
|
- if (!this._facetPositions) {
|
|
|
+ if (!this._facetData.facetPositions) {
|
|
|
this.updateFacetData();
|
|
|
}
|
|
|
- return this._facetPositions;
|
|
|
+ return this._facetData.facetPositions;
|
|
|
};
|
|
|
/**
|
|
|
* Returns the facetLocalPartioning array
|
|
@@ -21408,10 +21417,10 @@ var BABYLON;
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_facetdata
|
|
|
*/
|
|
|
AbstractMesh.prototype.getFacetLocalPartitioning = function () {
|
|
|
- if (!this._facetPartitioning) {
|
|
|
+ if (!this._facetData.facetPartitioning) {
|
|
|
this.updateFacetData();
|
|
|
}
|
|
|
- return this._facetPartitioning;
|
|
|
+ return this._facetData.facetPartitioning;
|
|
|
};
|
|
|
/**
|
|
|
* Returns the i-th facet position in the world system.
|
|
@@ -21472,13 +21481,14 @@ var BABYLON;
|
|
|
*/
|
|
|
AbstractMesh.prototype.getFacetsAtLocalCoordinates = function (x, y, z) {
|
|
|
var bInfo = this.getBoundingInfo();
|
|
|
- var ox = Math.floor((x - bInfo.minimum.x * this._partitioningBBoxRatio) * this._subDiv.X * this._partitioningBBoxRatio / this._bbSize.x);
|
|
|
- var oy = Math.floor((y - bInfo.minimum.y * this._partitioningBBoxRatio) * this._subDiv.Y * this._partitioningBBoxRatio / this._bbSize.y);
|
|
|
- var oz = Math.floor((z - bInfo.minimum.z * this._partitioningBBoxRatio) * this._subDiv.Z * this._partitioningBBoxRatio / this._bbSize.z);
|
|
|
- if (ox < 0 || ox > this._subDiv.max || oy < 0 || oy > this._subDiv.max || oz < 0 || oz > this._subDiv.max) {
|
|
|
+ var data = this._facetData;
|
|
|
+ var ox = Math.floor((x - bInfo.minimum.x * data.partitioningBBoxRatio) * data.subDiv.X * data.partitioningBBoxRatio / data.bbSize.x);
|
|
|
+ var oy = Math.floor((y - bInfo.minimum.y * data.partitioningBBoxRatio) * data.subDiv.Y * data.partitioningBBoxRatio / data.bbSize.y);
|
|
|
+ var oz = Math.floor((z - bInfo.minimum.z * data.partitioningBBoxRatio) * data.subDiv.Z * data.partitioningBBoxRatio / data.bbSize.z);
|
|
|
+ if (ox < 0 || ox > data.subDiv.max || oy < 0 || oy > data.subDiv.max || oz < 0 || oz > data.subDiv.max) {
|
|
|
return null;
|
|
|
}
|
|
|
- return this._facetPartitioning[ox + this._subDiv.max * oy + this._subDiv.max * this._subDiv.max * oz];
|
|
|
+ return data.facetPartitioning[ox + data.subDiv.max * oy + data.subDiv.max * data.subDiv.max * oz];
|
|
|
};
|
|
|
/**
|
|
|
* Returns the closest mesh facet index at (x,y,z) World coordinates, null if not found
|
|
@@ -21578,7 +21588,7 @@ var BABYLON;
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_facetdata
|
|
|
*/
|
|
|
AbstractMesh.prototype.getFacetDataParameters = function () {
|
|
|
- return this._facetParameters;
|
|
|
+ return this._facetData.facetParameters;
|
|
|
};
|
|
|
/**
|
|
|
* Disables the feature FacetData and frees the related memory
|
|
@@ -21586,13 +21596,13 @@ var BABYLON;
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_facetdata
|
|
|
*/
|
|
|
AbstractMesh.prototype.disableFacetData = function () {
|
|
|
- if (this._facetDataEnabled) {
|
|
|
- this._facetDataEnabled = false;
|
|
|
- this._facetPositions = new Array();
|
|
|
- this._facetNormals = new Array();
|
|
|
- this._facetPartitioning = new Array();
|
|
|
- this._facetParameters = null;
|
|
|
- this._depthSortedIndices = new Uint32Array(0);
|
|
|
+ if (this._facetData.facetDataEnabled) {
|
|
|
+ this._facetData.facetDataEnabled = false;
|
|
|
+ this._facetData.facetPositions = new Array();
|
|
|
+ this._facetData.facetNormals = new Array();
|
|
|
+ this._facetData.facetPartitioning = new Array();
|
|
|
+ this._facetData.facetParameters = null;
|
|
|
+ this._facetData.depthSortedIndices = new Uint32Array(0);
|
|
|
}
|
|
|
return this;
|
|
|
};
|
|
@@ -24398,7 +24408,7 @@ var BABYLON;
|
|
|
*/
|
|
|
function Scene(engine) {
|
|
|
var _this = _super.call(this) || this;
|
|
|
- // Members
|
|
|
+ // Members
|
|
|
/**
|
|
|
* Gets or sets a boolean that indicates if the scene must clear the render buffer before rendering a frame
|
|
|
*/
|
|
@@ -24658,21 +24668,25 @@ var BABYLON;
|
|
|
/**
|
|
|
* Gets or sets the fog color to use
|
|
|
* @see http://doc.babylonjs.com/babylon101/environment#fog
|
|
|
+ * (Default is Color3(0.2, 0.2, 0.3))
|
|
|
*/
|
|
|
_this.fogColor = new BABYLON.Color3(0.2, 0.2, 0.3);
|
|
|
/**
|
|
|
* Gets or sets the fog density to use
|
|
|
* @see http://doc.babylonjs.com/babylon101/environment#fog
|
|
|
+ * (Default is 0.1)
|
|
|
*/
|
|
|
_this.fogDensity = 0.1;
|
|
|
/**
|
|
|
* Gets or sets the fog start distance to use
|
|
|
* @see http://doc.babylonjs.com/babylon101/environment#fog
|
|
|
+ * (Default is 0)
|
|
|
*/
|
|
|
_this.fogStart = 0;
|
|
|
/**
|
|
|
* Gets or sets the fog end distance to use
|
|
|
* @see http://doc.babylonjs.com/babylon101/environment#fog
|
|
|
+ * (Default is 1000)
|
|
|
*/
|
|
|
_this.fogEnd = 1000.0;
|
|
|
// Lights
|
|
@@ -25152,6 +25166,7 @@ var BABYLON;
|
|
|
/**
|
|
|
* Gets or sets a boolean indicating if fog is enabled on this scene
|
|
|
* @see http://doc.babylonjs.com/babylon101/environment#fog
|
|
|
+ * (Default is true)
|
|
|
*/
|
|
|
set: function (value) {
|
|
|
if (this._fogEnabled === value) {
|
|
@@ -25170,6 +25185,12 @@ var BABYLON;
|
|
|
/**
|
|
|
* Gets or sets the fog mode to use
|
|
|
* @see http://doc.babylonjs.com/babylon101/environment#fog
|
|
|
+ * | mode | value |
|
|
|
+ * | --- | --- |
|
|
|
+ * | FOGMODE_NONE | 0 |
|
|
|
+ * | FOGMODE_EXP | 1 |
|
|
|
+ * | FOGMODE_EXP2 | 2 |
|
|
|
+ * | FOGMODE_LINEAR | 3 |
|
|
|
*/
|
|
|
set: function (value) {
|
|
|
if (this._fogMode === value) {
|
|
@@ -26076,7 +26097,7 @@ var BABYLON;
|
|
|
_this._processPointerDown(pickResult, evt);
|
|
|
};
|
|
|
this._onPointerUp = function (evt) {
|
|
|
- if (_this._totalPointersPressed === 0) { // We are attaching the pointer up to windows because of a bug in FF
|
|
|
+ if (_this._totalPointersPressed === 0) { // We are attaching the pointer up to windows because of a bug in FF
|
|
|
return; // So we need to test it the pointer down was pressed before.
|
|
|
}
|
|
|
_this._totalPointersPressed--;
|
|
@@ -26636,7 +26657,7 @@ var BABYLON;
|
|
|
var originalValue = holder.originalValue;
|
|
|
var scale = 1;
|
|
|
if (holder.totalWeight < 1.0) {
|
|
|
- // We need to mix the original value in
|
|
|
+ // We need to mix the original value in
|
|
|
originalValue.decompose(finalScaling, finalQuaternion, finalPosition);
|
|
|
scale = 1.0 - holder.totalWeight;
|
|
|
}
|
|
@@ -26739,7 +26760,7 @@ var BABYLON;
|
|
|
var startIndex = 0;
|
|
|
var normalizer = 1.0;
|
|
|
if (holder.totalWeight < 1.0) {
|
|
|
- // We need to mix the original value in
|
|
|
+ // We need to mix the original value in
|
|
|
if (originalValue.scale) {
|
|
|
finalValue = originalValue.scale(1.0 - holder.totalWeight);
|
|
|
}
|