# GLTFExtensionsPlugin

class in `3d-tiles-renderer/three/plugins`

```js
import { GLTFExtensionsPlugin } from '3d-tiles-renderer/three/plugins';
```

Plugin for automatically adding common extensions and loaders for 3D Tiles to the
`GLTFLoader` used for parsing tile geometry. A `DRACOLoader` can be provided to
support loading Draco-compressed point cloud files.

Example: Loading Draco and KTX2 compressed tiles

```js
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';
import { TilesRenderer } from '3d-tiles-renderer/three';
import { GLTFExtensionsPlugin } from '3d-tiles-renderer/three/plugins';

const URL = 'https://example.com/tileset.json';
const tiles = new TilesRenderer( URL );
tiles.registerPlugin( new GLTFExtensionsPlugin( {
	dracoLoader: new DRACOLoader(),
	ktxLoader: new KTX2Loader().detectSupport( renderer ),
} ) );
```

## Constructor

```js
new GLTFExtensionsPlugin( options?: Object )
```

- `options`, `Object`, optional
  - `metadata`, `boolean`, optional, default `true`: Enable the `EXT_structural_metadata` and `EXT_mesh_features` extensions.
  - `rtc`, `boolean`, optional, default `true`: Enable the `CESIUM_RTC` extension.
  - `plugins`, `Array`, optional, default `[]`: Additional GLTF loader plugins to pass to `GLTFLoader.register`.
  - `dracoLoader`, `Object`, optional, default `null`: A `DRACOLoader` instance for Draco-compressed geometry.
  - `ktxLoader`, `Object`, optional, default `null`: A `KTX2Loader` instance for KTX2-compressed textures.
  - `meshoptDecoder`, `Object`, optional, default `null`: A `MeshoptDecoder` for Meshopt-compressed meshes.
  - `autoDispose`, `boolean`, optional, default `true`: Automatically dispose the DRACO and KTX loaders on `dispose()`.
