@@ -32,7 +32,6 @@ import '../CrystalToolkitScene/CrystalToolkitScene.less';
32
32
import { CameraState } from '../CameraContextProvider/camera-reducer' ;
33
33
34
34
const POINTER_CLASS = 'show-pointer' ;
35
- let D ;
36
35
export default class Scene {
37
36
private settings ;
38
37
private renderer ! : THREE . WebGLRenderer | SVGRenderer ;
@@ -153,8 +152,6 @@ export default class Scene {
153
152
mountNode . appendChild ( labelRenderer . domElement ) ;
154
153
}
155
154
156
- componentDidUpdate = ( ) => { } ;
157
-
158
155
mouseMoveListener = ( e ) => {
159
156
if ( this . renderer instanceof WebGLRenderer || true ) {
160
157
// tooltips
@@ -397,7 +394,7 @@ export default class Scene {
397
394
size ,
398
395
padding ,
399
396
tiling ,
400
- maxTiling , // TODO
397
+ maxTiling ,
401
398
clickCallback ,
402
399
private dispatch : ( p : Vector3 , r : Quaternion , zoom : number ) => void ,
403
400
private debugDOMElement ?,
@@ -508,45 +505,6 @@ export default class Scene {
508
505
509
506
const objectToAnimate = new Set < string > ( ) ;
510
507
511
- // this is now defunct and should be removed, only included for comparison
512
- // TODO: remove traverse_scene
513
- const traverse_scene = ( o : SceneJsonObject , parent : THREE . Object3D , currentId : string ) => {
514
- o . contents ! . forEach ( ( childObject , idx ) => {
515
- if ( childObject . type ) {
516
- // if object can be made into a ThreeObject, add to scene and end recursion
517
- const object = this . makeObject ( childObject ) ;
518
- parent . add ( object ) ;
519
- this . threeUUIDTojsonObject [ object . uuid ] = childObject ;
520
- this . computeIdToThree [ `${ currentId } --${ idx } ` ] = object ;
521
- childObject . id = `${ currentId } --${ idx } ` ;
522
- if ( childObject . animate ) {
523
- objectToAnimate . add ( `${ currentId } --${ idx } ` ) ;
524
- }
525
- } else {
526
- // if object cannot be made into a ThreeObject, add empty child scene,
527
- // set origin, and recurse
528
- const threeObject = new THREE . Object3D ( ) ;
529
- threeObject . name = childObject . name ! ;
530
- this . computeIdToThree [ `${ currentId } --${ threeObject . name } ` ] = threeObject ;
531
- childObject . id = `${ currentId } --${ threeObject . name } ` ;
532
- threeObject . visible = childObject . visible === undefined ? true : ! ! childObject . visible ;
533
- if ( childObject . origin ) {
534
- const translation = new THREE . Matrix4 ( ) ;
535
- // note(chab) have a typedefinition for the JSON
536
- translation . makeTranslation ( ...( childObject . origin as ThreePosition ) ) ;
537
- threeObject . applyMatrix4 ( translation ) ;
538
- }
539
- if ( ! this . settings . extractAxis || threeObject . name !== 'axes' ) {
540
- parent . add ( threeObject ) ;
541
- }
542
- traverse_scene ( childObject , threeObject , `${ currentId } --${ threeObject . name } ` ) ;
543
- if ( threeObject . name === 'axes' ) {
544
- this . axis = threeObject . clone ( ) ;
545
- this . axisJson = { ...childObject } ;
546
- }
547
- }
548
- } ) ;
549
- } ;
550
508
/*
551
509
this function returns an array of tiles based on the tiling array
552
510
e.g. _getTiles([0, 1, 1] === [[0,0,0], [0,0,1], [0,1,1], [0,1,0]]
@@ -589,7 +547,6 @@ export default class Scene {
589
547
const tileRootObject = new THREE . Object3D ( ) ;
590
548
tileRootObject . name = sceneJson . name ! ;
591
549
sceneJson . visible && ( tileRootObject . visible = sceneJson . visible ) ;
592
- console . log ( this . arrayOfTileRoots ) ;
593
550
root . add ( tileRootObject ) ;
594
551
const [ x , y , z ] = tile ;
595
552
this . arrayOfTileRoots [ x ] [ y ] [ z ] . push ( tileRootObject ) ;
@@ -664,7 +621,7 @@ export default class Scene {
664
621
} ) ;
665
622
} ;
666
623
667
- // TODO: does it make sense to split this code into two cases?
624
+ // TODO: does it make sense to split this code into two cases? NO!
668
625
// set up the threeObjects and containers
669
626
const rootObject = new THREE . Object3D ( ) ;
670
627
if ( this . maxTiling > 0 ) {
@@ -684,7 +641,7 @@ export default class Scene {
684
641
685
642
// can cause memory leak
686
643
this . scene . add ( rootObject ) ;
687
- this . setupCamera ( rootObject ) ; // TODO: this could introduce issues if the new root is not compatible
644
+ this . setupCamera ( rootObject ) ;
688
645
689
646
// we try to update the outline from the preceding scene, but if the corresponding
690
647
// object is not there, we'll remove the outline
0 commit comments