Added World to the API. Can be used to check world dimensions and offsets. Cleaned up and added some comment in Viewer. After removing the reference to a lot of issues arose. The frontend and preview-service seems to use it extensively. Changed the calls referencing the interactions to the ones in the API where it was aplicable, and commented out with a note added for the ones that were not aplicable. We proably need to expose a generic way to manipulate the camera from the API

This commit is contained in:
AlexandruPopovici
2022-08-24 18:24:43 +03:00
parent 25c74556d0
commit 632ad53152
14 changed files with 165 additions and 332 deletions
+6 -3
View File
@@ -133,12 +133,14 @@ export default class SectionBox {
const val = !!event.value
if (val) {
this.dragging = val
this.viewer.interactions.preventSelection = val
//@Dim: Not sure what this needs to do in the new viewer
// this.viewer.interactions.preventSelection = val
this.viewer.cameraHandler.enabled = !val
} else {
setTimeout(() => {
this.dragging = val
this.viewer.interactions.preventSelection = val
//@Dim: Not sure what this needs to do in the new viewer
// this.viewer.interactions.preventSelection = val
this.viewer.cameraHandler.enabled = !val
}, 100)
}
@@ -351,9 +353,10 @@ export default class SectionBox {
if (targetBox) box = targetBox
else {
/* //@Dim: Not sure what this needs to do in the new viewer
if (this.viewer.interactions.selectedObjects.children.length !== 0) {
box = new THREE.Box3().setFromObject(this.viewer.interactions.selectedObjects)
} else if (this.viewer.speckleRenderer.allObjects.children.length !== 0) {
} else*/ if (this.viewer.speckleRenderer.allObjects.children.length !== 0) {
box = new THREE.Box3().setFromObject(this.viewer.speckleRenderer.allObjects)
} else {
box = new Box3(new THREE.Vector3(-1, -1, -1), new THREE.Vector3(1, 1, 1))