Pārlūkot izejas kodu

added options param to BoneLookController

Adam Bowman 8 gadi atpakaļ
vecāks
revīzija
a810a1d242
1 mainītis faili ar 16 papildinājumiem un 4 dzēšanām
  1. 16 4
      src/Bones/babylon.boneLookController.ts

+ 16 - 4
src/Bones/babylon.boneLookController.ts

@@ -18,15 +18,27 @@ module BABYLON {
         private _tmpMat1 = Matrix.Identity();
         private _tmpMat2 = Matrix.Identity();
 
-        constructor(mesh: AbstractMesh, bone: Bone, target: Vector3, adjustYaw: number = 0, adjustPitch: number = 0, adjustRoll: number = 0){
+        constructor(mesh: AbstractMesh, bone: Bone, target: Vector3, options?: {adjustYaw?: number, adjustPitch?: number, adjustRoll?: number} ){
 
             this.mesh = mesh;
             this.bone = bone;
             this.target = target;
 
-            this.adjustYaw = adjustYaw;
-            this.adjustPitch = adjustPitch;
-            this.adjustRoll = adjustRoll;
+            if(options){
+
+                if(options.adjustYaw){
+                    this.adjustYaw = options.adjustYaw;
+                }
+
+                if(options.adjustPitch){
+                    this.adjustPitch = options.adjustPitch;
+                }
+
+                if(options.adjustRoll){
+                    this.adjustRoll = options.adjustRoll;
+                }
+
+            }
 
         }