|
@@ -9517,7 +9517,7 @@ 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 offset = indices[index];
|
|
|
+ var offset = indices[index] * 3;
|
|
|
var x = positions[offset];
|
|
|
var y = positions[offset + 1];
|
|
|
var z = positions[offset + 2];
|
|
@@ -18930,9 +18930,21 @@ var BABYLON;
|
|
|
* @param max defines the maximum vector (in local space)
|
|
|
*/
|
|
|
function BoundingSphere(min, max) {
|
|
|
+ /**
|
|
|
+ * Gets the center of the bounding sphere in local space
|
|
|
+ */
|
|
|
this.center = BABYLON.Vector3.Zero();
|
|
|
+ /**
|
|
|
+ * Gets the center of the bounding sphere in world space
|
|
|
+ */
|
|
|
this.centerWorld = BABYLON.Vector3.Zero();
|
|
|
+ /**
|
|
|
+ * Gets the minimum vector in local space
|
|
|
+ */
|
|
|
this.minimum = BABYLON.Vector3.Zero();
|
|
|
+ /**
|
|
|
+ * Gets the maximum vector in local space
|
|
|
+ */
|
|
|
this.maximum = BABYLON.Vector3.Zero();
|
|
|
this.reConstruct(min, max);
|
|
|
}
|
|
@@ -21461,9 +21473,10 @@ var BABYLON;
|
|
|
if (!this.subMeshes) {
|
|
|
return this;
|
|
|
}
|
|
|
- for (var subIndex = 0; subIndex < this.subMeshes.length; subIndex++) {
|
|
|
+ var count = this.subMeshes.length;
|
|
|
+ for (var subIndex = 0; subIndex < count; subIndex++) {
|
|
|
var subMesh = this.subMeshes[subIndex];
|
|
|
- if (!subMesh.IsGlobal) {
|
|
|
+ if (count > 1 || !subMesh.IsGlobal) {
|
|
|
subMesh.updateBoundingInfo(matrix);
|
|
|
}
|
|
|
}
|
|
@@ -35279,7 +35292,7 @@ var BABYLON;
|
|
|
if (!boundingInfo) {
|
|
|
return false;
|
|
|
}
|
|
|
- return boundingInfo.isInFrustum(frustumPlanes);
|
|
|
+ return boundingInfo.isInFrustum(frustumPlanes, this._mesh.cullingStrategy);
|
|
|
};
|
|
|
/**
|
|
|
* True is the submesh bounding box is completely inside the frustum defined by the passed array of planes
|
|
@@ -67501,7 +67514,7 @@ var BABYLON;
|
|
|
};
|
|
|
var positions = instance.getVerticesData(BABYLON.VertexBuffer.PositionKind);
|
|
|
positionFunction(positions);
|
|
|
- instance._boundingInfo = new BABYLON.BoundingInfo(BABYLON.Tmp.Vector3[0], BABYLON.Tmp.Vector3[1]);
|
|
|
+ instance._boundingInfo = new BABYLON.BoundingInfo(BABYLON.Tmp.Vector3[2], BABYLON.Tmp.Vector3[3]);
|
|
|
instance._boundingInfo.update(instance._worldMatrix);
|
|
|
instance.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positions, false, false);
|
|
|
if (options.colors) {
|
|
@@ -67561,7 +67574,7 @@ var BABYLON;
|
|
|
ribbon._creationDataStorage.idx = vertexData._idx;
|
|
|
}
|
|
|
ribbon._creationDataStorage.closePath = closePath;
|
|
|
- ribbon._closeArray = closeArray;
|
|
|
+ ribbon._creationDataStorage.closeArray = closeArray;
|
|
|
vertexData.applyToMesh(ribbon, updatable);
|
|
|
return ribbon;
|
|
|
}
|
|
@@ -68245,8 +68258,8 @@ var BABYLON;
|
|
|
var path3D;
|
|
|
var pathArray;
|
|
|
if (instance) { // tube update
|
|
|
- var arc = options.arc || instance.arc;
|
|
|
var storage = instance._creationDataStorage;
|
|
|
+ var arc = options.arc || storage.arc;
|
|
|
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 });
|
|
@@ -68263,7 +68276,6 @@ var BABYLON;
|
|
|
cap = (cap < 0 || cap > 3) ? 0 : cap;
|
|
|
pathArray = tubePathArray(path, path3D, newPathArray, radius, tessellation, radiusFunction, cap, options.arc);
|
|
|
var tube = MeshBuilder.CreateRibbon(name, { pathArray: pathArray, closePath: true, closeArray: false, updatable: updatable, sideOrientation: sideOrientation, invertUV: invertUV, frontUVs: options.frontUVs, backUVs: options.backUVs }, scene);
|
|
|
- tube._creationDataStorage = new BABYLON._CreationDataStorage();
|
|
|
tube._creationDataStorage.pathArray = pathArray;
|
|
|
tube._creationDataStorage.path3D = path3D;
|
|
|
tube._creationDataStorage.tessellation = tessellation;
|
|
@@ -68571,7 +68583,6 @@ var BABYLON;
|
|
|
cap = (cap < 0 || cap > 3) ? 0 : cap;
|
|
|
pathArray = extrusionPathArray(shape, curve, path3D, newShapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom);
|
|
|
var extrudedGeneric = MeshBuilder.CreateRibbon(name, { pathArray: pathArray, closeArray: rbCA, closePath: rbCP, updatable: updtbl, sideOrientation: side, invertUV: invertUV, frontUVs: frontUVs || undefined, backUVs: backUVs || undefined }, scene);
|
|
|
- extrudedGeneric._creationDataStorage = new BABYLON._CreationDataStorage();
|
|
|
extrudedGeneric._creationDataStorage.pathArray = pathArray;
|
|
|
extrudedGeneric._creationDataStorage.path3D = path3D;
|
|
|
extrudedGeneric._creationDataStorage.cap = cap;
|