|
@@ -7059,7 +7059,7 @@ var BABYLON;
|
|
|
Engine._TEXTUREFORMAT_LUMINANCE = 1;
|
|
|
Engine._TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
|
|
|
Engine._TEXTUREFORMAT_RGB = 4;
|
|
|
- Engine._TEXTUREFORMAT_RGBA = 4;
|
|
|
+ Engine._TEXTUREFORMAT_RGBA = 5;
|
|
|
Engine._TEXTURETYPE_UNSIGNED_INT = 0;
|
|
|
Engine._TEXTURETYPE_FLOAT = 1;
|
|
|
// Updatable statics so stick with vars here
|
|
@@ -15881,17 +15881,19 @@ var BABYLON;
|
|
|
}
|
|
|
return shapePaths;
|
|
|
};
|
|
|
+ var path3D;
|
|
|
+ var pathArray;
|
|
|
if (instance) {
|
|
|
- var path3D = (instance.path3D).update(curve);
|
|
|
- var pathArray = extrusionPathArray(shape, curve, instance.path3D, instance.pathArray, scale, rotation, scaleFunction, rotateFunction, instance.cap, custom);
|
|
|
+ path3D = (instance.path3D).update(curve);
|
|
|
+ pathArray = extrusionPathArray(shape, curve, instance.path3D, instance.pathArray, scale, rotation, scaleFunction, rotateFunction, instance.cap, custom);
|
|
|
instance = Mesh.CreateRibbon(null, pathArray, null, null, null, null, null, null, instance);
|
|
|
return instance;
|
|
|
}
|
|
|
// extruded shape creation
|
|
|
- var path3D = new BABYLON.Path3D(curve);
|
|
|
+ path3D = new BABYLON.Path3D(curve);
|
|
|
var newShapePaths = new Array();
|
|
|
cap = (cap < 0 || cap > 3) ? 0 : cap;
|
|
|
- var pathArray = extrusionPathArray(shape, curve, path3D, newShapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom);
|
|
|
+ pathArray = extrusionPathArray(shape, curve, path3D, newShapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom);
|
|
|
var extrudedGeneric = Mesh.CreateRibbon(name, pathArray, rbCA, rbCP, 0, scene, updtbl, side);
|
|
|
extrudedGeneric.pathArray = pathArray;
|
|
|
extrudedGeneric.path3D = path3D;
|
|
@@ -16037,17 +16039,19 @@ var BABYLON;
|
|
|
}
|
|
|
return circlePaths;
|
|
|
};
|
|
|
+ var path3D;
|
|
|
+ var pathArray;
|
|
|
if (tubeInstance) {
|
|
|
- var path3D = (tubeInstance.path3D).update(path);
|
|
|
- var pathArray = tubePathArray(path, path3D, tubeInstance.pathArray, radius, tubeInstance.tessellation, radiusFunction, tubeInstance.cap);
|
|
|
+ path3D = (tubeInstance.path3D).update(path);
|
|
|
+ pathArray = tubePathArray(path, path3D, tubeInstance.pathArray, radius, tubeInstance.tessellation, radiusFunction, tubeInstance.cap);
|
|
|
tubeInstance = Mesh.CreateRibbon(null, pathArray, null, null, null, null, null, null, tubeInstance);
|
|
|
return tubeInstance;
|
|
|
}
|
|
|
// tube creation
|
|
|
- var path3D = new BABYLON.Path3D(path);
|
|
|
+ path3D = new BABYLON.Path3D(path);
|
|
|
var newPathArray = new Array();
|
|
|
cap = (cap < 0 || cap > 3) ? 0 : cap;
|
|
|
- var pathArray = tubePathArray(path, path3D, newPathArray, radius, tessellation, radiusFunction, cap);
|
|
|
+ pathArray = tubePathArray(path, path3D, newPathArray, radius, tessellation, radiusFunction, cap);
|
|
|
var tube = Mesh.CreateRibbon(name, pathArray, false, true, 0, scene, updatable, sideOrientation);
|
|
|
tube.pathArray = pathArray;
|
|
|
tube.path3D = path3D;
|
|
@@ -16091,8 +16095,7 @@ var BABYLON;
|
|
|
// Get normal
|
|
|
result.normal = new BABYLON.Vector3(normals[vertexId * 3], normals[vertexId * 3 + 1], normals[vertexId * 3 + 2]);
|
|
|
return result;
|
|
|
- };
|
|
|
- // Inspired by https://github.com/mrdoob/three.js/blob/eee231960882f6f3b6113405f524956145148146/examples/js/geometries/DecalGeometry.js
|
|
|
+ }; // Inspired by https://github.com/mrdoob/three.js/blob/eee231960882f6f3b6113405f524956145148146/examples/js/geometries/DecalGeometry.js
|
|
|
var clip = function (vertices, axis) {
|
|
|
if (vertices.length === 0) {
|
|
|
return vertices;
|
|
@@ -16203,7 +16206,6 @@ var BABYLON;
|
|
|
continue;
|
|
|
}
|
|
|
// Add UVs and get back to world
|
|
|
- var localRotationMatrix = BABYLON.Matrix.RotationYawPitchRoll(yaw, pitch, angle);
|
|
|
for (var vIndex = 0; vIndex < faceVertices.length; vIndex++) {
|
|
|
var vertex = faceVertices[vIndex];
|
|
|
vertexData.indices.push(currentVertexDataIndex);
|
|
@@ -16239,15 +16241,16 @@ var BABYLON;
|
|
|
if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind)) {
|
|
|
return this;
|
|
|
}
|
|
|
+ var source;
|
|
|
if (!this._sourcePositions) {
|
|
|
- var source = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
|
|
|
+ source = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
|
|
|
this._sourcePositions = new Float32Array(source);
|
|
|
if (!this.getVertexBuffer(BABYLON.VertexBuffer.PositionKind).isUpdatable()) {
|
|
|
this.setVerticesData(BABYLON.VertexBuffer.PositionKind, source, true);
|
|
|
}
|
|
|
}
|
|
|
if (!this._sourceNormals) {
|
|
|
- var source = this.getVerticesData(BABYLON.VertexBuffer.NormalKind);
|
|
|
+ source = this.getVerticesData(BABYLON.VertexBuffer.NormalKind);
|
|
|
this._sourceNormals = new Float32Array(source);
|
|
|
if (!this.getVertexBuffer(BABYLON.VertexBuffer.NormalKind).isUpdatable()) {
|
|
|
this.setVerticesData(BABYLON.VertexBuffer.NormalKind, source, true);
|
|
@@ -16268,7 +16271,6 @@ var BABYLON;
|
|
|
var matricesWeight2 = matricesWeightsData[index4 + 2];
|
|
|
var matricesWeight3 = matricesWeightsData[index4 + 3];
|
|
|
if (matricesWeight0 > 0) {
|
|
|
- var matricesIndex0 = matricesIndicesData[index4];
|
|
|
BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[index4] * 16, matricesWeight0, tempMatrix);
|
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
|
}
|
|
@@ -16327,10 +16329,11 @@ var BABYLON;
|
|
|
*/
|
|
|
Mesh.MergeMeshes = function (meshes, disposeSource, allow32BitsIndices, meshSubclass) {
|
|
|
if (disposeSource === void 0) { disposeSource = true; }
|
|
|
+ var index;
|
|
|
if (!allow32BitsIndices) {
|
|
|
var totalVertices = 0;
|
|
|
// Counting vertices
|
|
|
- for (var index = 0; index < meshes.length; index++) {
|
|
|
+ for (index = 0; index < meshes.length; index++) {
|
|
|
if (meshes[index]) {
|
|
|
totalVertices += meshes[index].getTotalVertices();
|
|
|
if (totalVertices > 65536) {
|