# Sayduck's customized version of three.js glTF loader

## Installation

```
npm i --save @sayduck/three-gltf-loader
```

## Description

three.js's [GLTFLoader](https://threejs.org/docs/#examples/loaders/GLTFLoader) wrapped as a module for easy importing, [TypeScript type definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/three/three-gltfloader.d.ts) included.

## Usage

```javascript
import * as THREE from "three";
import GLTFLoader from "three-gltf-loader";

const loader = new GLTFLoader();
loader.load(
  "path/to/your/file.gltf",
  gltf => {
    // called when the resource is loaded
    scene.add(gltf.scene);
  },
  xhr => {
    // called while loading is progressing
    console.log(`${(xhr.loaded / xhr.total) * 100}% loaded`);
  },
  error => {
    // called when loading has errors
    console.error("An error happened", error);
  }
);
```

For further documentation, see [the official GLTFLoader docs](https://threejs.org/docs/#examples/loaders/GLTFLoader).
