xzw 1 vuosi sitten
vanhempi
commit
09f2c3bf0f
1 muutettua tiedostoa jossa 9 lisäystä ja 8 poistoa
  1. 9 8
      src/sdk/cover/index.js

+ 9 - 8
src/sdk/cover/index.js

@@ -468,7 +468,12 @@ export const enter = (dom, isLocal) => {
                     props.rotation = new THREE.Euler().setFromVector3(props.rotation)
                 }
             }
-
+            let getDefaultRotation = ()=>{
+                //0看看,1看见,2深时,3用户上传三维模型,4深时mesh,5深光点云,6深光mesh
+                if(props.fromType == 1 || props.fromType == 4 || props.fromType == 6 ){//来自4dkk的3dtiles初始需要转90度
+                    return new THREE.Euler(Math.PI/2, 0,0)
+                }else return new THREE.Euler(0,0,0)
+            } 
 
 
             if(!props.isFirstLoad){ 
@@ -487,7 +492,7 @@ export const enter = (dom, isLocal) => {
                 autoLoads.push(props)
                 readyToAddModel = false               
             }else{
-                props.rotation = result.getDefaultRotation()
+                props.rotation = getDefaultRotation()
                 readyToAddModel = true 
             }
              
@@ -608,6 +613,7 @@ export const enter = (dom, isLocal) => {
             let scaleMeasure
             let result = {  
                 bus,
+                getDefaultRotation,
                 changeShow(show){ 
                     props.show = show  //for autoLoads show model
                     if(model){  
@@ -656,12 +662,7 @@ export const enter = (dom, isLocal) => {
                     model && model.rotation.setFromVector3(rot) 
                     model.dispatchEvent({type:'rotation_changed'})  
                 },
-                getDefaultRotation(){
-                    //0看看,1看见,2深时,3用户上传三维模型,4深时mesh,5深光点云,6深光mesh
-                    if(props.fromType == 1 || props.fromType == 4 || props.fromType == 6 ){//来自4dkk的3dtiles初始需要转90度
-                        return new THREE.Euler(Math.PI/2, 0,0)
-                    }else return new THREE.Euler(0,0,0)
-                },
+                
                 enterRotateMode(){
                     if(model){
                         if(MergeEditor.split){//分屏校准