|
@@ -141,6 +141,9 @@ export const createBoard = (
|
|
|
const ret = {
|
|
|
...board,
|
|
|
bus,
|
|
|
+ get store() {
|
|
|
+ return board.getData();
|
|
|
+ },
|
|
|
setData(data, { angle, center } = { angle: 0, center: new Vector3() }) {
|
|
|
// console.log(angle, center);
|
|
|
// center.x = 1.5097999572753906;
|
|
@@ -148,25 +151,20 @@ export const createBoard = (
|
|
|
centerR = center;
|
|
|
rotationZ = -angle;
|
|
|
center = new Vector3(-center.x, center.y, -center.z);
|
|
|
- const id = "Point181";
|
|
|
+ // const id = "Point181";
|
|
|
setMat
|
|
|
.identity()
|
|
|
.multiply(new Matrix3().makeTranslation(-center.x, -center.z))
|
|
|
.multiply(new Matrix3().makeRotation(rotationZ))
|
|
|
.multiply(new Matrix3().makeTranslation(center.x, center.z));
|
|
|
- console.log(data.rooms[0].points.find((p) => p.id === id));
|
|
|
data = rotateData(data, setMat);
|
|
|
- console.log(data.rooms[0].points.find((p) => p.id === id));
|
|
|
return board.setData(data);
|
|
|
},
|
|
|
getData() {
|
|
|
let data = board.getData();
|
|
|
- const id = "Point181";
|
|
|
- console.log(data.rooms[0].points.find((p) => p.id === id));
|
|
|
+ // const id = "Point181";
|
|
|
data = rotateData(data, setMat.clone().invert());
|
|
|
- console.log(data.rooms[0].points.find((p) => p.id === id));
|
|
|
|
|
|
- console.log("???", data);
|
|
|
// throw "1";
|
|
|
return data;
|
|
|
},
|
|
@@ -251,7 +249,6 @@ export const createBoard = (
|
|
|
showPois() {
|
|
|
if (!board.tree.entrys.pois) return;
|
|
|
const pois = board.tree.entrys.pois as Entity[];
|
|
|
- console.log(pois);
|
|
|
pois.forEach((poi) => poi.visible(true));
|
|
|
},
|
|
|
hidenPois() {
|
|
@@ -270,11 +267,9 @@ export const createBoard = (
|
|
|
pois.forEach((poi) => poi.setShowLabel(false));
|
|
|
},
|
|
|
addPoi(type: string) {
|
|
|
- console.error(type);
|
|
|
if (!pois()) {
|
|
|
const data = board.getData();
|
|
|
data.pois = [];
|
|
|
- console.log("???");
|
|
|
}
|
|
|
board.tree.bus.emit("dataChangeBefore");
|
|
|
const { promise, interrupt } = addEntityAttrib(board.tree, (pos) => {
|