Multi Viewer (#1518)

* Fixed an issue with HDRIs not generating proper PMREMs over multiple viewer instances

* WIP on makign the world tree multiple instanced

* The WorldTree is no longer static. Each viewer has it's own instance and it hands it over to whoever needs it.

* Fixed an issue with filtering and the new non-static tree. Also removed the 'root' key from the NodeData structure since it's not needed

* Added an guard when building batches for situations where all render views have invalid geometries. This generally means there is somethign wrong with the stream itself

* multi-viewer css fixes

---------

Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
This commit is contained in:
Alexandru Popovici
2023-04-21 13:12:15 +03:00
committed by GitHub
parent 90439d7d41
commit 4aef572a44
23 changed files with 888 additions and 648 deletions
@@ -3,6 +3,7 @@ import { ViewerEvent } from '../IViewer'
import Converter from './converter/Converter'
import EventEmitter from './EventEmitter'
import Logger from 'js-logger'
import { Viewer } from './Viewer'
/**
* Helper wrapper around the ObjectLoader class, with some built in assumptions.
*/
@@ -22,8 +23,8 @@ export default class ViewerObjectLoader {
return this._objectUrl
}
constructor(parentEmitter: EventEmitter, objectUrl, authToken, enableCaching) {
this.emiter = parentEmitter
constructor(parent: Viewer, objectUrl, authToken, enableCaching) {
this.emiter = parent
this._objectUrl = objectUrl
this.token = null
try {
@@ -64,7 +65,7 @@ export default class ViewerObjectLoader {
options: { enableCaching, customLogger: (Logger as any).log }
})
this.converter = new Converter(this.loader)
this.converter = new Converter(this.loader, parent.getWorldTree())
this.cancel = false
}