Prechádzať zdrojové kódy

added options param to BoneLookController

Adam Bowman 8 rokov pred
rodič
commit
a810a1d242
1 zmenil súbory, kde vykonal 16 pridanie a 4 odobranie
  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 _tmpMat1 = Matrix.Identity();
         private _tmpMat2 = 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.mesh = mesh;
             this.bone = bone;
             this.bone = bone;
             this.target = target;
             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;
+                }
+
+            }
 
 
         }
         }