# GLTFLoader

class in `3d-tiles-renderer/playcanvas`, extends `LoaderBase`

```js
import { GLTFLoader } from '3d-tiles-renderer/playcanvas';
```

PlayCanvas loader for GLTF and GLB tile content. The already downloaded buffer is passed to the
engine as the contents of a `container` asset, so the engine's glTF parser and extensions are
used without fetching the file again.

## Constructor

```js
new GLTFLoader( app: AppBase )
```

- `app`, `AppBase`: The PlayCanvas application.

## Properties

### .app: AppBase

The PlayCanvas application the content is created for.

### .assetOptions: Object | null

Options passed to the `container` asset, such as glTF parser callbacks.

### .renderOptions: Object | null

Options passed to the render components created for the content, such as `castShadows`.

## Methods

### .parse

```js
async .parse( buffer: ArrayBuffer, url: string ): Promise<{scene: Entity, container: Asset, gltf: Object, asset: Object}>
```

- `buffer`, `ArrayBuffer`: The raw GLTF or GLB file data.
- `url`, `string`: The URL of the content, used to resolve relative resources.

Returns `Promise<{scene: Entity, container: Asset, gltf: Object, asset: Object}>`: The
entity created for the content, the `container` asset it was loaded from, the glTF JSON, and
its `asset` property, which holds the copyright of the content.
