Przeglądaj źródła

update documentation for tile visibility callback

ligaofeng 3 lat temu
rodzic
commit
1a2dd7058f
3 zmienionych plików z 10 dodań i 0 usunięć
  1. 8 0
      README.md
  2. 1 0
      src/three/TilesRenderer.d.ts
  3. 1 0
      src/three/TilesRenderer.js

+ 8 - 0
README.md

@@ -478,6 +478,14 @@ onDisposeModel = null : ( scene : Object3D, tile : Tile ) => void
 
 Callback that is called every time a model is disposed of. This should be used in conjunction with [.onLoadModel](#onLoadModel) to dispose of any custom materials created for a tile. Note that the textures, materials, and geometries that a tile loaded in with are all automatically disposed of even if they have been removed from the tile meshes.
 
+### .onTileVisibilityChange
+
+```js
+onTileVisibilityChange = null : ( scene : Object3D, tile : Tile, visible : boolean ) => void
+```
+
+Callback that is called when a tile's visibility changed. The parameter `visible` is `true` when the tile is visible
+
 ### .dispose
 
 ```js

+ 1 - 0
src/three/TilesRenderer.d.ts

@@ -30,6 +30,7 @@ export class TilesRenderer extends TilesRendererBase {
 	onLoadTileSet : ( ( tileSet : Tileset ) => void ) | null;
 	onLoadModel : ( ( scene : Object3D, tile : Tile ) => void ) | null;
 	onDisposeModel : ( ( scene : Object3D, tile : Tile ) => void ) | null;
+	onTileVisibilityChange : ( ( scene : Object3D, tile : Tile, visible : boolean ) => void ) | null;
 
 
 }

+ 1 - 0
src/three/TilesRenderer.js

@@ -802,6 +802,7 @@ export class TilesRenderer extends TilesRendererBase {
 			this.onTileVisibilityChange( scene, tile, visible );
 
 		}
+
 	}
 
 	setTileActive( tile, active ) {