|
@@ -1,15 +1,20 @@
|
|
|
import * as THREE from 'three';
|
|
|
import UseThree from '../../../../utils/threejs/useThree';
|
|
|
import ChamberBase from './grout.threejs.base';
|
|
|
+import BertaiBase from './bertai.threejs.base'; //lxh
|
|
|
import { animateCamera } from '/@/utils/threejs/util';
|
|
|
import useEvent from '../../../../utils/threejs/useEvent';
|
|
|
|
|
|
// 模型对象、 文字对象
|
|
|
let model: UseThree | undefined,
|
|
|
groutBaseObj: ChamberBase | undefined,
|
|
|
- group: THREE.Object3D | undefined,
|
|
|
- groutType = 'groutBase'; // workerFaceFiber
|
|
|
|
|
|
+ BertaiObj: BertaiBase | undefined, //lxh
|
|
|
+
|
|
|
+ group: THREE.Object3D | undefined,
|
|
|
+ // groutType = 'groutBase'; // workerFaceFiber
|
|
|
+ groutType = 'bertaiBase'; // workerFaceFiber
|
|
|
+
|
|
|
const { mouseDownFn } = useEvent();
|
|
|
|
|
|
// 鼠标点击事件
|
|
@@ -18,6 +23,8 @@ const mouseEvent = (event) => {
|
|
|
mouseDownFn(<UseThree>model, <THREE.Object3D>group, event, (intersects) => {
|
|
|
if (groutType === 'groutBase') {
|
|
|
// groutBaseObj.mousedownModel.call(groutBaseObj, model.rayCaster);
|
|
|
+ }else if(groutType==='bertaiBase'){//lxh
|
|
|
+ // BertaiObj.mousedownModel.call(BertaiObj, model.rayCaster);
|
|
|
}
|
|
|
});
|
|
|
console.log('摄像头控制信息', model?.orbitControls, model?.camera);
|
|
@@ -40,6 +47,8 @@ const addMouseEvent = () => {
|
|
|
export const addChamberText = (selectData) => {
|
|
|
if (groutType === 'groutBase') {
|
|
|
return groutBaseObj?.addChamberText.call(groutBaseObj, selectData);
|
|
|
+ }else if(groutType=='bertaiBase'){//lxh
|
|
|
+ return BertaiObj?.addChamberText.call(BertaiObj, selectData);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -61,7 +70,21 @@ export const setModelType = (type) => {
|
|
|
0.6
|
|
|
);
|
|
|
}, 300);
|
|
|
-
|
|
|
+ resolve(null);
|
|
|
+ }else if(groutType === 'bertaiBase' && BertaiObj && BertaiObj.group){//lxh
|
|
|
+ group = BertaiObj.group;
|
|
|
+ const oldCameraPosition = { x: -114.7969, y: 104.0741, z: 303.516 };
|
|
|
+ model?.scene?.add(BertaiObj.group);
|
|
|
+ setTimeout(async () => {
|
|
|
+ await animateCamera(
|
|
|
+ oldCameraPosition,
|
|
|
+ { x: 0, y: 0, z: 0 },
|
|
|
+ { x: -36.224455845316, y: 21.749986776845592, z: -0.10614789855468158 },
|
|
|
+ { x: 0, y: 0, z: 0 },
|
|
|
+ model,
|
|
|
+ 0.6
|
|
|
+ );
|
|
|
+ }, 300);
|
|
|
resolve(null);
|
|
|
}
|
|
|
});
|
|
@@ -76,6 +99,9 @@ export const mountedThree = () => {
|
|
|
groutBaseObj = new ChamberBase(model);
|
|
|
await groutBaseObj.mountedThree();
|
|
|
|
|
|
+ BertaiObj=new BertaiBase(model) //lxh
|
|
|
+ await BertaiObj.mountedThree();//lxh
|
|
|
+
|
|
|
addMouseEvent();
|
|
|
model.animate();
|
|
|
resolve(null);
|
|
@@ -88,6 +114,8 @@ export const destroy = () => {
|
|
|
console.log('场景销毁前信息----------->', model.renderer?.info);
|
|
|
groutBaseObj?.destroy();
|
|
|
groutBaseObj = undefined;
|
|
|
+ BertaiObj?.destroy();
|
|
|
+ BertaiObj = undefined;
|
|
|
group = undefined;
|
|
|
model.destroy();
|
|
|
model = undefined;
|