Skip to content

Commit

Permalink
Merge branch 'master' into mp_main
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Buchhofer committed Mar 14, 2022
2 parents 906ff05 + f3854d1 commit ddf0fa0
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 20 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased
## [0.3.6] - 2022-01-29
### Fixed
- "onPreprocessUrl" is now called for initial Tileset URL.

## [0.3.5] - 2022-01-06
### Added
- `TilesRenderer.onTileVisibilityChange` callback.
- Support for GLTF in tilesets (`3DTILES_content_gltf` extension).

### Changed
- Improved type definitions.
- `PNTSLoader.parse` now returns a promise.
- All model loaders on inherit from a common type.

## [0.3.4] - 2021-11-15
### Added
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function renderLoop() {
// before calling tilesRenderer.update
camera.updateMatrixWorld();
tilesRenderer.update();
renderer.render( camera, scene );
renderer.render( scene, camera );

}
```
Expand Down Expand Up @@ -197,7 +197,7 @@ function renderLoop() {
needsRerender = false;
camera.updateMatrixWorld();
tilesRenderer.update();
renderer.render( camera, scene );
renderer.render( scene, camera );

}

Expand Down
27 changes: 15 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "3d-tiles-renderer",
"version": "0.3.4",
"version": "0.3.6",
"description": "https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification",
"keywords": [
"3d-tiles",
Expand Down
2 changes: 2 additions & 0 deletions src/base/TileBase.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,6 @@ export interface TileBase {

refine?: 'REPLACE' | 'ADD';

transform?: number[];

}
2 changes: 1 addition & 1 deletion src/base/TilesRendererBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export class TilesRendererBase {
if ( ! ( url in tileSets ) ) {

const pr = this
.fetchTileSet( url, this.fetchOptions )
.fetchTileSet( this.preprocessURL ? this.preprocessURL( url ) : url, this.fetchOptions )
.then( json => {

tileSets[ url ] = json;
Expand Down
3 changes: 2 additions & 1 deletion src/three/GLTFExtensionLoader.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
import { LoaderBase } from '../base/LoaderBase';
import { LoadingManager } from 'three';

export class GLTFExtensionLoader {
export class GLTFExtensionLoader extends LoaderBase {

constructor( manager : LoadingManager );
parse( buffer : ArrayBuffer ) : Promise< GLTF >;
Expand Down
21 changes: 19 additions & 2 deletions src/three/GLTFExtensionLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,30 @@ export class GLTFExtensionLoader extends LoaderBase {
return new Promise( ( resolve, reject ) => {

const manager = this.manager;
const fetchOptions = this.fetchOptions;
let loader = manager.getHandler( 'path.gltf' ) || manager.getHandler( 'path.glb' );

if ( ! loader ) {

loader = new GLTFLoader( manager );
loader.crossOrigin = this.crossOrigin;
loader.withCredentials = this.withCredentials;
if ( fetchOptions.credentials === 'include' && fetchOptions.mode === 'cors' ) {

loader.setCrossOrigin( 'use-credentials' );

}

if ( 'credentials' in fetchOptions ) {

loader.setWithCredentials( fetchOptions.credentials === 'include' );

}

if ( fetchOptions.headers ) {

loader.setRequestHeader( fetchOptions.headers );

}


}

Expand Down

0 comments on commit ddf0fa0

Please sign in to comment.