xzw 4 月之前
父节点
当前提交
4f9e3de8fc
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/sdk/cover/index.js

+ 4 - 4
src/sdk/cover/index.js

@@ -1005,7 +1005,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                 })
                 let lastState = {}
                 model.addEventListener('transformChanged', (e) => {
-                    let msg = {byControl:!!e.byControl}  //byControl代表是手动用控制轴修改 
+                    let msg = {byControl:!!e.byControl}  //byControl代表是手动用控制轴修改 动画文件要改帧
                     if (!lastState.position || !model.position.equals(lastState.position)) {
                         lastState.position = msg.position = model.position.clone()
                         //console.log('change pos', model.name, model.position.toArray())
@@ -1123,7 +1123,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                     
                     MergeEditor.moveBoundCenterTo(model, pos3d)  //使模型中心的xy在鼠标所在位置
                      
-                    model.dispatchEvent("position_changed") 
+                    model.dispatchEvent({type:"position_changed", byControl:true}) 
                 },
 
                 changeShow(show) {
@@ -1177,7 +1177,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                     }else{
                         model && model.position.copy(pos)
                     }
-                    model.dispatchEvent({ type: 'position_changed' })
+                    model.dispatchEvent({ type: 'position_changed'/* , byControl:true */})
                 },
                 changeRotation(rot) {//校准取消时执行 
                     //console.log('changeRotation', model.name, rot.x, rot.y, rot.z)
@@ -1187,7 +1187,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                     }else{ */
                         model && model.rotation.setFromVector3(rot)
                     //} 
-                    model.dispatchEvent({ type: 'rotation_changed' , by2d:true})
+                    model.dispatchEvent({ type: 'rotation_changed' , by2d:true/* , byControl:true */})
                 },
                 getModelPose(){
                     return {