浏览代码

Merge pull request #1031 from ssatguru/master

added method getAnimationRanges() to babylon.skeleton.ts
David Catuhe 9 年之前
父节点
当前提交
817f38c9d0
共有 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 on 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