|
@@ -55889,9 +55889,9 @@ var BABYLON;
|
|
|
//For now pointDepth will not be used and will be automatically calculated.
|
|
|
//Future reference - try and find the best place to add a reference to the pointDepth variable.
|
|
|
var arraySize = pointDepth || ~~(Math.sqrt(pos.length / 3) - 1);
|
|
|
- var dim = Math.min(object.getBoundingInfo().boundingBox.extendSize.x, object.getBoundingInfo().boundingBox.extendSize.z);
|
|
|
+ var dim = Math.min(object.getBoundingInfo().boundingBox.extendSizeWorld.x, object.getBoundingInfo().boundingBox.extendSizeWorld.z);
|
|
|
var elementSize = dim * 2 / arraySize;
|
|
|
- var minY = object.getBoundingInfo().boundingBox.extendSize.y;
|
|
|
+ var minY = object.getBoundingInfo().boundingBox.extendSizeWorld.y;
|
|
|
for (var i = 0; i < pos.length; i = i + 3) {
|
|
|
var x = Math.round((pos[i + 0]) / elementSize + arraySize / 2);
|
|
|
var z = Math.round(((pos[i + 2]) / elementSize - arraySize / 2) * -1);
|
|
@@ -55961,15 +55961,15 @@ var BABYLON;
|
|
|
//rotation is back
|
|
|
mesh.rotationQuaternion = rotationQuaternion;
|
|
|
//calculate the new center using a pivot (since Cannon.js doesn't center height maps)
|
|
|
- var p = BABYLON.Matrix.Translation(mesh.getBoundingInfo().boundingBox.extendSize.x, 0, -mesh.getBoundingInfo().boundingBox.extendSize.z);
|
|
|
+ var p = BABYLON.Matrix.Translation(mesh.getBoundingInfo().boundingBox.extendSizeWorld.x, 0, -mesh.getBoundingInfo().boundingBox.extendSizeWorld.z);
|
|
|
mesh.setPivotMatrix(p);
|
|
|
mesh.computeWorldMatrix(true);
|
|
|
//calculate the translation
|
|
|
var translation = mesh.getBoundingInfo().boundingBox.centerWorld.subtract(center).subtract(mesh.position).negate();
|
|
|
- this._tmpPosition.copyFromFloats(translation.x, translation.y - mesh.getBoundingInfo().boundingBox.extendSize.y, translation.z);
|
|
|
+ this._tmpPosition.copyFromFloats(translation.x, translation.y - mesh.getBoundingInfo().boundingBox.extendSizeWorld.y, translation.z);
|
|
|
//add it inverted to the delta
|
|
|
this._tmpDeltaPosition.copyFrom(mesh.getBoundingInfo().boundingBox.centerWorld.subtract(c));
|
|
|
- this._tmpDeltaPosition.y += mesh.getBoundingInfo().boundingBox.extendSize.y;
|
|
|
+ this._tmpDeltaPosition.y += mesh.getBoundingInfo().boundingBox.extendSizeWorld.y;
|
|
|
mesh.setPivotMatrix(oldPivot);
|
|
|
mesh.computeWorldMatrix(true);
|
|
|
}
|