File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/components/crystal-toolkit/scene Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -400,8 +400,8 @@ export default class Scene {
400
400
private debugDOMElement ?,
401
401
cameraState ?: CameraState
402
402
) {
403
- this . tiling = tiling ;
404
- this . maxTiling = maxTiling ;
403
+ this . tiling = tiling || 0 ;
404
+ this . maxTiling = maxTiling || [ 0 , 0 , 0 ] ;
405
405
this . arrayOfTileRoots = Scene . getEmptyTilesArray ( [
406
406
this . maxTiling ,
407
407
this . maxTiling ,
@@ -522,6 +522,10 @@ export default class Scene {
522
522
return tiles ;
523
523
} ;
524
524
525
+ const _alternateTiles = ( x : number ) => {
526
+ return ( - 1 ) ** ( x + 1 ) * Math . trunc ( ( x + 1 ) / 2 ) ;
527
+ } ;
528
+
525
529
const emptyLattice = [
526
530
[ 0 , 0 , 0 ] ,
527
531
[ 0 , 0 , 0 ] ,
@@ -547,7 +551,9 @@ export default class Scene {
547
551
this . arrayOfTileRoots [ x ] [ y ] [ z ] . push ( tileRootObject ) ;
548
552
549
553
let tileOffsets : number [ ] [ ] = lattice . map ( ( vector : number [ ] , index : number ) => {
550
- return vector . map ( ( x : number ) => x * tile [ index ] ) ;
554
+ return vector . map ( ( x : number ) => {
555
+ return x * _alternateTiles ( tile [ index ] ) ;
556
+ } ) ;
551
557
} ) ;
552
558
traverseScene ( sceneJson , tileRootObject , tileOffsets , '' ) ;
553
559
}
You can’t perform that action at this time.
0 commit comments