|
@@ -34,6 +34,9 @@ export default class Scene extends Mitt {
|
|
this.width = 0;
|
|
this.width = 0;
|
|
this.height = 0;
|
|
this.height = 0;
|
|
this.defaultZoom = 250;
|
|
this.defaultZoom = 250;
|
|
|
|
+ this.initCamPView = new THREE.Vector3();
|
|
|
|
+ this.initCamRView = new THREE.Vector3();
|
|
|
|
+
|
|
this.inited = false;
|
|
this.inited = false;
|
|
|
|
|
|
this.init = () => {
|
|
this.init = () => {
|
|
@@ -88,7 +91,7 @@ export default class Scene extends Mitt {
|
|
|
|
|
|
load = (list, type, data) => {
|
|
load = (list, type, data) => {
|
|
if (!list) return;
|
|
if (!list) return;
|
|
- console.log("scene: ", list, type, data);
|
|
|
|
|
|
+ // console.log("scene: ", list, type, data);
|
|
//axesHeloer
|
|
//axesHeloer
|
|
this.clearScene();
|
|
this.clearScene();
|
|
this.sceneType = type;
|
|
this.sceneType = type;
|
|
@@ -99,6 +102,8 @@ export default class Scene extends Mitt {
|
|
//light
|
|
//light
|
|
this.loadLight();
|
|
this.loadLight();
|
|
this.player.load(type, data || []);
|
|
this.player.load(type, data || []);
|
|
|
|
+ this.initCamPView.copy(this.orthCamera.position);
|
|
|
|
+ this.initCamRView.copy(this.orthCamera.rotation);
|
|
};
|
|
};
|
|
|
|
|
|
clearScene() {
|
|
clearScene() {
|
|
@@ -178,6 +183,14 @@ export default class Scene extends Mitt {
|
|
stats.end();
|
|
stats.end();
|
|
requestAnimationFrame(this.animate);
|
|
requestAnimationFrame(this.animate);
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+ resetCameraView() {
|
|
|
|
+ this.orthCamera.zoom = this.defaultZoom;
|
|
|
|
+ this.orthCamera.position.copy(this.initCamPView);
|
|
|
|
+ this.orthCamera.rotation.copy(this.initCamRView);
|
|
|
|
+ // this.orthCamera.updateMatrixWorld();
|
|
|
|
+ }
|
|
|
|
+
|
|
editing(item) {
|
|
editing(item) {
|
|
this.player.editing(item);
|
|
this.player.editing(item);
|
|
}
|
|
}
|
|
@@ -238,8 +251,9 @@ export default class Scene extends Mitt {
|
|
|
|
|
|
test1() {
|
|
test1() {
|
|
const object = this.boxManager.model;
|
|
const object = this.boxManager.model;
|
|
- for (var i = 0; i <= object; i++) {
|
|
|
|
- console.log(object[i]);
|
|
|
|
|
|
+ for (var i = 0; i <= object.children.length; i++) {
|
|
|
|
+ console.log(object.children[i]);
|
|
|
|
+ this.scene.lookAt(this.boxManager.model);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|