Sfoglia il codice sorgente

Small last minute bugs

David Catuhe 7 anni fa
parent
commit
8280f6e56b

File diff suppressed because it is too large
+ 3866 - 3865
Playground/babylon.d.txt


File diff suppressed because it is too large
+ 3866 - 3865
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.js


+ 20 - 9
dist/preview release/babylon.max.js

@@ -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;

+ 20 - 9
dist/preview release/babylon.no-module.max.js

@@ -9484,7 +9484,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];
@@ -18897,9 +18897,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);
         }
@@ -21428,9 +21440,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);
                 }
             }
@@ -35246,7 +35259,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
@@ -67468,7 +67481,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) {
@@ -67528,7 +67541,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;
             }
@@ -68212,8 +68225,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 });
@@ -68230,7 +68243,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;
@@ -68538,7 +68550,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;

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.worker.js


+ 20 - 9
dist/preview release/es6.js

@@ -9484,7 +9484,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];
@@ -18897,9 +18897,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);
         }
@@ -21428,9 +21440,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);
                 }
             }
@@ -35246,7 +35259,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
@@ -67468,7 +67481,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) {
@@ -67528,7 +67541,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;
             }
@@ -68212,8 +68225,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 });
@@ -68230,7 +68243,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;
@@ -68538,7 +68550,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;

+ 5 - 19
dist/preview release/viewer/babylon.viewer.d.ts

@@ -168,11 +168,11 @@ declare module BabylonViewer {
                 * Mainly used for help and errors
                 * @param subScreen the name of the subScreen. Those can be defined in the configuration object
                 */
-            showOverlayScreen(subScreen: string): Promise<Template> | Promise<string>;
+            showOverlayScreen(subScreen: string): Promise<string> | Promise<Template>;
             /**
                 * Hide the overlay screen.
                 */
-            hideOverlayScreen(): Promise<Template> | Promise<string>;
+            hideOverlayScreen(): Promise<string> | Promise<Template>;
             /**
                 * show the viewer (in case it was hidden)
                 *
@@ -189,11 +189,11 @@ declare module BabylonViewer {
                 * Show the loading screen.
                 * The loading screen can be configured using the configuration object
                 */
-            showLoadingScreen(): Promise<Template> | Promise<string>;
+            showLoadingScreen(): Promise<string> | Promise<Template>;
             /**
                 * Hide the loading screen
                 */
-            hideLoadingScreen(): Promise<Template> | Promise<string>;
+            hideLoadingScreen(): Promise<string> | Promise<Template>;
             dispose(): void;
             protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
     }
@@ -924,7 +924,7 @@ declare module BabylonViewer {
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 declare module BabylonViewer {
@@ -1558,20 +1558,6 @@ declare module BabylonViewer {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 declare module BabylonViewer {
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-declare module BabylonViewer {
 }
 declare module BabylonViewer {
     export interface IEnvironmentMapConfiguration {

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 5 - 22
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -200,11 +200,11 @@ declare module 'babylonjs-viewer/viewer/defaultViewer' {
                 * Mainly used for help and errors
                 * @param subScreen the name of the subScreen. Those can be defined in the configuration object
                 */
-            showOverlayScreen(subScreen: string): Promise<Template> | Promise<string>;
+            showOverlayScreen(subScreen: string): Promise<string> | Promise<Template>;
             /**
                 * Hide the overlay screen.
                 */
-            hideOverlayScreen(): Promise<Template> | Promise<string>;
+            hideOverlayScreen(): Promise<string> | Promise<Template>;
             /**
                 * show the viewer (in case it was hidden)
                 *
@@ -221,11 +221,11 @@ declare module 'babylonjs-viewer/viewer/defaultViewer' {
                 * Show the loading screen.
                 * The loading screen can be configured using the configuration object
                 */
-            showLoadingScreen(): Promise<Template> | Promise<string>;
+            showLoadingScreen(): Promise<string> | Promise<Template>;
             /**
                 * Hide the loading screen
                 */
-            hideLoadingScreen(): Promise<Template> | Promise<string>;
+            hideLoadingScreen(): Promise<string> | Promise<Template>;
             dispose(): void;
             protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
     }
@@ -985,14 +985,13 @@ declare module 'babylonjs-viewer/templating/viewerTemplatePlugin' {
 }
 
 declare module 'babylonjs-viewer/optimizer/custom' {
-    import { extendedUpgrade } from "babylonjs-viewer/optimizer/custom/extended";
     import { SceneManager } from "babylonjs-viewer/managers/sceneManager";
     /**
       *
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 
@@ -1663,22 +1662,6 @@ declare module 'babylonjs-viewer/loader/plugins' {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 
-declare module 'babylonjs-viewer/optimizer/custom/extended' {
-    import { SceneManager } from 'babylonjs-viewer/managers/sceneManager';
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-
 declare module 'babylonjs-viewer/configuration/interfaces' {
     export * from 'babylonjs-viewer/configuration/interfaces/cameraConfiguration';
     export * from 'babylonjs-viewer/configuration/interfaces/colorGradingConfiguration';

+ 1 - 0
src/Mesh/babylon.mesh.ts

@@ -5,6 +5,7 @@
      **/
     export class _CreationDataStorage {
         public closePath?: boolean;
+        public closeArray?: boolean;
         public idx: number[];
         public dashSize: number;
         public gapSize: number;

+ 12 - 14
src/Mesh/babylon.meshBuilder.ts

@@ -211,7 +211,7 @@
                 };
                 var positions = <FloatArray>instance.getVerticesData(VertexBuffer.PositionKind);
                 positionFunction(positions);
-                instance._boundingInfo = new BoundingInfo(Tmp.Vector3[0], Tmp.Vector3[1]);
+                instance._boundingInfo = new BoundingInfo(Tmp.Vector3[2], Tmp.Vector3[3]);
                 instance._boundingInfo.update(instance._worldMatrix);
                 instance.updateVerticesData(VertexBuffer.PositionKind, positions, false, false);
                 if (options.colors) {
@@ -275,7 +275,7 @@
                     ribbon._creationDataStorage.idx = (<any>vertexData)._idx;
                 }
                 ribbon._creationDataStorage.closePath = closePath;
-                (<any>ribbon)._closeArray = closeArray;
+                ribbon._creationDataStorage.closeArray = closeArray;
 
                 vertexData.applyToMesh(ribbon, updatable);
 
@@ -1027,8 +1027,8 @@
             var path3D;
             var pathArray;
             if (instance) { // tube update
-                var arc = options.arc || (<any>instance).arc;
                 let 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 });
@@ -1047,13 +1047,12 @@
             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 _CreationDataStorage();
-            tube._creationDataStorage.pathArray = pathArray;
-            tube._creationDataStorage.path3D = path3D;
-            tube._creationDataStorage.tessellation = tessellation;
-            tube._creationDataStorage.cap = cap;
-            tube._creationDataStorage.arc = options.arc;
-            tube._creationDataStorage.radius = radius;
+            tube._creationDataStorage!.pathArray = pathArray;
+            tube._creationDataStorage!.path3D = path3D;
+            tube._creationDataStorage!.tessellation = tessellation;
+            tube._creationDataStorage!.cap = cap;
+            tube._creationDataStorage!.arc = options.arc;
+            tube._creationDataStorage!.radius = radius;
 
             return tube;
         }
@@ -1407,10 +1406,9 @@
             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 _CreationDataStorage();
-            extrudedGeneric._creationDataStorage.pathArray = pathArray;
-            extrudedGeneric._creationDataStorage.path3D = path3D;
-            extrudedGeneric._creationDataStorage.cap = cap;
+            extrudedGeneric._creationDataStorage!.pathArray = pathArray;
+            extrudedGeneric._creationDataStorage!.path3D = path3D;
+            extrudedGeneric._creationDataStorage!.cap = cap;
 
             return extrudedGeneric;
         }

+ 1 - 1
src/Tools/babylon.tools.ts

@@ -503,7 +503,7 @@
             var maximum = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
 
             for (var index = indexStart; index < indexStart + indexCount; index++) {
-                const offset = indices[index];
+                const offset = indices[index] * 3;
                 const x = positions[offset];
                 const y = positions[offset + 1];
                 const z = positions[offset + 2];

BIN
tests/validation/ReferenceImages/ribbon morphing.png


+ 6 - 0
tests/validation/config.json

@@ -2,6 +2,12 @@
   "root": "https://rawgit.com/BabylonJS/Website/master",
   "tests": [
     {
+      "title": "Ribbon morphing",
+      "playgroundId": "#ACKC2#1",
+      "renderCount": 50,
+      "referenceImage": "ribbon morphing.png"
+    },    
+    {
       "title": "Clip planes",
       "playgroundId": "#Y6W087#0",
       "referenceImage": "clipplanes.png"