David Catuhe 7 年之前
父节点
当前提交
e806bc954b

文件差异内容过多而无法显示
+ 9850 - 9850
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.js


文件差异内容过多而无法显示
+ 17 - 5
dist/preview release/babylon.max.js


文件差异内容过多而无法显示
+ 17 - 5
dist/preview release/babylon.no-module.max.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.worker.js


文件差异内容过多而无法显示
+ 17 - 5
dist/preview release/es6.js


+ 26 - 0
dist/preview release/viewer/babylon.viewer.d.ts

@@ -1649,6 +1649,32 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    /**
+        * Defines an animation to be applied to a model (translation, scale or rotation).
+        */
+    export interface IModelAnimationConfiguration {
+            /**
+                * Time of animation, in seconds
+                */
+            time?: number;
+            /**
+                * Scale to apply
+                */
+            scaling?: {
+                    x: number;
+                    y: number;
+                    z: number;
+            };
+            /**
+                * Easing function to apply
+                */
+            easingFunction?: number;
+            /**
+                * An Easing mode to apply to the easing function
+                * See BABYLON.EasingFunction
+                */
+            easingMode?: number;
+    }
 }
 declare module BabylonViewer {
     export class TelemetryLoaderPlugin implements ILoaderPlugin {

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 26 - 1
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -1776,7 +1776,32 @@ declare module 'babylonjs-viewer/labs/viewerLabs' {
 }
 
 declare module 'babylonjs-viewer/configuration/interfaces/modelAnimationConfiguration' {
-    
+    /**
+        * Defines an animation to be applied to a model (translation, scale or rotation).
+        */
+    export interface IModelAnimationConfiguration {
+            /**
+                * Time of animation, in seconds
+                */
+            time?: number;
+            /**
+                * Scale to apply
+                */
+            scaling?: {
+                    x: number;
+                    y: number;
+                    z: number;
+            };
+            /**
+                * Easing function to apply
+                */
+            easingFunction?: number;
+            /**
+                * An Easing mode to apply to the easing function
+                * See BABYLON.EasingFunction
+                */
+            easingMode?: number;
+    }
 }
 
 declare module 'babylonjs-viewer/loader/plugins/telemetryLoaderPlugin' {

+ 19 - 4
src/Mesh/babylon.mesh.vertexData.ts

@@ -413,10 +413,25 @@
                 }
 
                 var offset = this.positions ? this.positions.length / 3 : 0;
-                for (var index = 0; index < other.indices.length; index++) {
-                    //TODO check type - if Int32Array | Uint32Array | Uint16Array!
-                    (<number[]>this.indices).push(other.indices[index] + offset);
-                }
+
+                var isSrcTypedArray = (<any>this.indices).BYTES_PER_ELEMENT !== undefined;
+
+                if (isSrcTypedArray) {
+                    var len = this.indices.length + other.indices.length;
+                    var temp = this.indices instanceof Uint32Array ? new Uint32Array(len) : new Uint16Array(len);
+                    temp.set(this.indices);
+
+                    let decal = this.indices.length;
+                    for (var index = 0; index < other.indices.length; index++) {
+                        temp[decal + index] = other.indices[index] + offset;
+                    }
+
+                    this.indices = temp;
+                } else {
+                    for (var index = 0; index < other.indices.length; index++) {
+                        (<number[]>this.indices).push(other.indices[index] + offset);
+                    }
+                }                
             }
 
             this.positions = this._mergeElement(this.positions, other.positions);