|
@@ -84,7 +84,6 @@ export default class Player {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- load() {}
|
|
|
init = () => {
|
|
|
// //floorplanControls
|
|
|
// this.floorplanControls = new FloorplanControls(
|
|
@@ -402,18 +401,36 @@ export default class Player {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- console.log("sceneType", this.scene.sceneType);
|
|
|
+ // console.log("sceneType", this.scene.sceneType);
|
|
|
return data;
|
|
|
}
|
|
|
- // syncDrawData() {
|
|
|
- // const data = {
|
|
|
- // line: this.renderLines,
|
|
|
- // activeEdges: this.activeEdges,
|
|
|
- // markers: this.renderMarkers,
|
|
|
- // };
|
|
|
- // this.scene.emit("sync", data);
|
|
|
- // }
|
|
|
+ load(type, data) {
|
|
|
+ if (type === 1) {
|
|
|
+ console.log("data1", data);
|
|
|
+ const { activeEdges, hor_lines, hor_markers } = data;
|
|
|
+ activeEdges && (this.activeEdges = activeEdges);
|
|
|
+ if (hor_lines && Array.isArray(hor_lines)) {
|
|
|
+ this.renderLines = hor_lines;
|
|
|
+ hor_lines.forEach((line) => {
|
|
|
+ const finishLine = new LinePoints(line, 0, this.matLine);
|
|
|
+ this.scene.scene.add(finishLine);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (hor_markers && Array.isArray(hor_markers)) {
|
|
|
+ this.renderMarkers = hor_markers;
|
|
|
+ hor_markers.forEach((pos) => {
|
|
|
+ console.log("pos");
|
|
|
+ const p = new THREE.Vector3().fromArray(pos.point);
|
|
|
+ const marker = new Marker(p);
|
|
|
+ this.scene.scene.add(marker);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ if (type === 2) {
|
|
|
+ console.log("data2", data);
|
|
|
+ }
|
|
|
+ }
|
|
|
reset() {
|
|
|
if (this.marker) {
|
|
|
this.scene.scene.remove(this.marker);
|