Explorar o código

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 %!s(int64=9) %!d(string=hai) anos
pai
achega
10c3c25f86
Modificáronse 1 ficheiros con 14 adicións e 0 borrados
  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