Explorar o código

Merge pull request #1520 from abow/spotlight_rotation

added Spotlight.getRotation
David Catuhe %!s(int64=8) %!d(string=hai) anos
pai
achega
2be1a63193
Modificáronse 1 ficheiros con 11 adicións e 0 borrados
  1. 11 0
      src/Lights/babylon.spotLight.ts

+ 11 - 0
src/Lights/babylon.spotLight.ts

@@ -118,5 +118,16 @@
         public getTypeID(): number {
             return 2;
         }
+
+        public getRotation(): Vector3 {
+
+            this.direction.normalize();
+
+            var xaxis = BABYLON.Vector3.Cross(this.direction, BABYLON.Axis.Y);
+            var yaxis = BABYLON.Vector3.Cross(xaxis, this.direction);
+
+            return Vector3.RotationFromAxis(xaxis, yaxis, this.direction);
+
+        }
     }
 }