This commit is contained in:
hzz 2023-05-23 15:45:50 +08:00
parent 65dc4db91a
commit 64f76afd05

View File

@ -269,6 +269,12 @@ const init = () => {
//
const mesh_hr = createFloor(t('messages.machineDesign'), 45, 120, { x: -431, y: 0, z: 102 })
createLableObj(mesh_hr, t('messages.machineDesign'), { x: 0, y: 60, z: 0 })
const mesh_serve = createFloor('', 45, 48, { x: -364.5, y: 0, z: 58 })
createLableObj(mesh_serve, '服务器机房', { x: 0, y: 60, z: 0 })
//
const mesh_dkcj = createFloor(t('messages.ControllerRoom'), 76.5, 237, { x: -266, y: 0, z: -138.5 })
createLableObj(mesh_dkcj, t('messages.ControllerRoom'), { x: 0, y: 60, z: 0 })
@ -556,7 +562,7 @@ const init = () => {
const intersects = raycaster.intersectObjects(scene.children);
if (intersects.length > 0) {
var selected = intersects[0]; //
console.log("坐标", "{x:" + selected.point.x.toFixed(2) + ",y:" + (selected.point.y.toFixed(2) - 1) + ",z:" + selected.point.z.toFixed(2) + "}");
console.log("坐标", "{x:" + selected.point.x.toFixed(2) + ",y:" + (selected.point.y.toFixed(2) - 1) + ",z:" + selected.point.z.toFixed(2) + "}",selected.object.name);
// console.log("", "{x:" + (+selected.point.x - 0.83).toFixed(2) + ",y:2 ,z:" + (selected.point.z + 3.52).toFixed(2) + "}");
let workerShop = intersects[0]?.object?.name
if (workerShopRoute.hasOwnProperty(workerShop) && !edit) {
@ -797,7 +803,6 @@ function createGlb() {
mesh.position.set(-346, 0, 51);
mesh.castShadow = true;
mesh.receiveShadow = true;
createLableObj(mesh, '服务器', { x: 0, y: 60, z: 0 })
scene.add(mesh);
}, undefined, function (error) {
@ -828,7 +833,7 @@ function createHouse(houseName: string, size = { baseWidth: 40, baseHeght: 4, ba
const mesh = createFloor('焊接车间', baseWidth, baseLength, position)
createLableObj(mesh, t('messages.HanJieRoom'), { x: 0, y: 60, z: 0 })
} else {
const mesh = createFloor('houseName', baseWidth, baseLength, position)
const mesh = createFloor(houseName, baseWidth, baseLength, position)
createLableObj(mesh, houseName, { x: 0, y: 60, z: 0 })
}
}