Procházet zdrojové kódy

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js into NPM

sebavan před 5 roky
rodič
revize
83ae13ad5a

+ 7 - 7
Viewer/src/managers/sceneManager.ts

@@ -372,7 +372,7 @@ export class SceneManager {
      * initialize the scene. Calling this function again will dispose the old scene, if exists.
      */
     public initScene(sceneConfiguration: ISceneConfiguration = {}, optimizerConfiguration?: boolean | ISceneOptimizerConfiguration): Promise<Scene> {
-        
+
         // if the scen exists, dispose it.
         if (this.scene) {
             this.scene.dispose();
@@ -485,7 +485,7 @@ export class SceneManager {
             }
 
             if (this.environmentHelper && newConfiguration.lab.environmentMainColor) {
-                let mainColor = new Color3().copyFrom(newConfiguration.lab.environmentMainColor as Color3);
+                let mainColor = new Color3(newConfiguration.lab.environmentMainColor.r, newConfiguration.lab.environmentMainColor.g, newConfiguration.lab.environmentMainColor.b);
                 this.environmentHelper.setMainColor(mainColor);
             }
 
@@ -594,8 +594,8 @@ export class SceneManager {
         }
     }
 
-    public setDefaultMaterial(sceneConfig: ISceneConfiguration){
-        
+    public setDefaultMaterial(sceneConfig: ISceneConfiguration) {
+
     }
 
     /**
@@ -927,7 +927,7 @@ export class SceneManager {
             if (canvas) {
                 this.scene.activeCamera.attachControl(canvas);
             }
-            
+
             this.camera = <ArcRotateCamera>this.scene.activeCamera!;
             this.camera.setTarget(Vector3.Zero());
         }
@@ -1275,11 +1275,11 @@ export class SceneManager {
 
                     if (lightConfig.target) {
                         if (light.setDirectionToTarget) {
-                            let target = Vector3.Zero().copyFrom(lightConfig.target as Vector3);
+                            let target = Vector3.Zero().copyFromFloats(lightConfig.target.x, lightConfig.target.y, lightConfig.target.z);
                             light.setDirectionToTarget(target);
                         }
                     } else if (lightConfig.direction) {
-                        let direction = Vector3.Zero().copyFrom(lightConfig.direction as Vector3);
+                        let direction = Vector3.Zero().copyFromFloats(lightConfig.direction.x, lightConfig.direction.y, lightConfig.direction.z);
                         light.direction = direction;
                     }
 

+ 1 - 1
Viewer/src/model/viewerModel.ts

@@ -497,7 +497,7 @@ export class ViewerModel implements IDisposable {
         }
 
         if (this._modelConfiguration.rotationOffsetAxis) {
-            let rotationAxis = new Vector3(0, 0, 0).copyFrom(this._modelConfiguration.rotationOffsetAxis as Vector3);
+            let rotationAxis = new Vector3(this._modelConfiguration.rotationOffsetAxis.x, this._modelConfiguration.rotationOffsetAxis.y, this._modelConfiguration.rotationOffsetAxis.z);
 
             meshesWithNoParent.forEach((m) => {
                 if (this._modelConfiguration.rotationOffsetAngle) {

+ 3 - 3
Viewer/src/viewer/viewer.ts

@@ -174,7 +174,7 @@ export abstract class AbstractViewer {
         return this._configurationContainer;
     }
 
-    protected getConfigurationLoader(){
+    protected getConfigurationLoader() {
         return new RenderOnlyConfigurationLoader();
     }
 
@@ -298,7 +298,7 @@ export abstract class AbstractViewer {
             // position the vr camera to be in front of the object or wherever the user has configured it to be
             if (this.sceneManager.vrHelper.currentVRCamera && this.sceneManager.vrHelper.currentVRCamera !== this.sceneManager.camera) {
                 if (this.configuration.vr && this.configuration.vr.cameraPosition !== undefined) {
-                    this.sceneManager.vrHelper.currentVRCamera.position.copyFrom(this.configuration.vr.cameraPosition as Vector3);
+                    this.sceneManager.vrHelper.currentVRCamera.position.copyFromFloats(this.configuration.vr.cameraPosition.x, this.configuration.vr.cameraPosition.y, this.configuration.vr.cameraPosition.z);
                 } else {
                     this.sceneManager.vrHelper.currentVRCamera.position.copyFromFloats(0, this.sceneManager.vrHelper.currentVRCamera.position.y, -1);
                 }
@@ -750,7 +750,7 @@ export abstract class AbstractViewer {
             // We can decide here whether or not to cancel the lst load, but the developer can do that.
             return Promise.reject("another model is curently being loaded.");
         }
-        
+
         return Promise.resolve(this.sceneManager.scene).then((scene) => {
             if (!scene) { return this.sceneManager.initScene(this.configuration.scene, this.configuration.optimizer); }
             return scene;