Переглянути джерело

Update babylon.skeleton.ts

Added a method to return as an Array, all AnimationRanges defined for this skeleton. This could  be useful to applications like editors which might want to display a list of animations available  on a skeleton
ssatguru 9 роки тому
батько
коміт
10c3c25f86
1 змінених файлів з 14 додано та 0 видалено
  1. 14 0
      src/Bones/babylon.skeleton.ts

+ 14 - 0
src/Bones/babylon.skeleton.ts

@@ -82,6 +82,20 @@
         public getAnimationRange(name: string): AnimationRange {
             return this._ranges[name];
         }
+        
+        /**
+         *  Returns as an Array, all AnimationRanges defined for this skeleton
+         */
+        public getAnimationRanges(): AnimationRange[] {
+            var animationRanges :  AnimationRange[] = [];
+            var name : string;
+            var i: number = 0;
+            for (name in this._ranges){
+                animationRanges[i] = this._ranges[name];
+                i++;
+            }
+            return animationRanges;
+        }
 
         /** 
          *  note: This is not for a complete retargeting, only between very similar skeleton's with only possible bone length differences