|
@@ -580,6 +580,26 @@ export class TilesRenderer extends TilesRendererBase {
|
|
|
const loadIndex = tile._loadIndex;
|
|
|
let promise = null;
|
|
|
|
|
|
+ const upAxis = this.rootTileSet.asset && this.rootTileSet.asset.gltfUpAxis || 'y';
|
|
|
+ const cached = tile.cached;
|
|
|
+ const cachedTransform = cached.transform;
|
|
|
+
|
|
|
+ switch ( upAxis.toLowerCase() ) {
|
|
|
+
|
|
|
+ case 'x':
|
|
|
+ tempMat.makeRotationAxis( Y_AXIS, - Math.PI / 2 );
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 'y':
|
|
|
+ tempMat.makeRotationAxis( X_AXIS, Math.PI / 2 );
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 'z':
|
|
|
+ tempMat.identity();
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
switch ( extension ) {
|
|
|
|
|
|
case 'b3dm': {
|
|
@@ -587,6 +607,9 @@ export class TilesRenderer extends TilesRendererBase {
|
|
|
const loader = new B3DMLoader( manager );
|
|
|
loader.workingPath = workingPath;
|
|
|
loader.fetchOptions = fetchOptions;
|
|
|
+
|
|
|
+ loader.adjustmentTransform.copy( tempMat );
|
|
|
+
|
|
|
promise = loader
|
|
|
.parse( buffer )
|
|
|
.then( res => res.scene );
|
|
@@ -611,6 +634,9 @@ export class TilesRenderer extends TilesRendererBase {
|
|
|
const loader = new I3DMLoader( manager );
|
|
|
loader.workingPath = workingPath;
|
|
|
loader.fetchOptions = fetchOptions;
|
|
|
+
|
|
|
+ loader.adjustmentTransform.copy( tempMat );
|
|
|
+
|
|
|
promise = loader
|
|
|
.parse( buffer )
|
|
|
.then( res => res.scene );
|
|
@@ -623,6 +649,9 @@ export class TilesRenderer extends TilesRendererBase {
|
|
|
const loader = new CMPTLoader( manager );
|
|
|
loader.workingPath = workingPath;
|
|
|
loader.fetchOptions = fetchOptions;
|
|
|
+
|
|
|
+ loader.adjustmentTransform.copy( tempMat );
|
|
|
+
|
|
|
promise = loader
|
|
|
.parse( buffer )
|
|
|
.then( res => res.scene );
|
|
@@ -655,27 +684,6 @@ export class TilesRenderer extends TilesRendererBase {
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- const upAxis = this.rootTileSet.asset && this.rootTileSet.asset.gltfUpAxis || 'y';
|
|
|
- const cached = tile.cached;
|
|
|
- const cachedTransform = cached.transform;
|
|
|
-
|
|
|
- switch ( upAxis.toLowerCase() ) {
|
|
|
-
|
|
|
- case 'x':
|
|
|
- tempMat.makeRotationAxis( Y_AXIS, - Math.PI / 2 );
|
|
|
- break;
|
|
|
-
|
|
|
- case 'y':
|
|
|
- tempMat.makeRotationAxis( X_AXIS, Math.PI / 2 );
|
|
|
- break;
|
|
|
-
|
|
|
- case 'z':
|
|
|
- tempMat.identity();
|
|
|
- break;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
// ensure the matrix is up to date in case the scene has a transform applied
|
|
|
scene.updateMatrix();
|
|
|
|
|
@@ -684,7 +692,7 @@ export class TilesRenderer extends TilesRendererBase {
|
|
|
// any transformations applied to it can be assumed to be applied after load
|
|
|
// (such as applying RTC_CENTER) meaning they should happen _after_ the z-up
|
|
|
// rotation fix which is why "multiply" happens here.
|
|
|
- if ( extension !== 'pnts' ) {
|
|
|
+ if ( extension === 'glb' || extension === 'gltf' ) {
|
|
|
|
|
|
scene.matrix.multiply( tempMat );
|
|
|
|