# Class GLTFLoader

GLTF 模型加载器

#### Hierarchy (View Summary)

- THREEGLTFLoader
  - GLTFLoader

- Defined in lib/gltf-loader/index.ts:41

##### Index

### Constructors

constructor

### Properties

ddsLoader
dracoLoader

### Accessors

version

### Methods

load
parse
setDDSLoader
setDRACOLoader

## Constructors

### constructor

- new GLTFLoader(manager?: LoadingManager): GLTFLoader

  GLTF 模型加载器

  #### Parameters

  - `Optional` manager: LoadingManager

  #### Returns GLTFLoader

  #### Example

      const gltfLoader = new GLTFLoader();
      gltfLoader.load("https://vr-public.realsee-cdn.cn/release/static/image/release/five/demo/gltf/plants/scene.gltf", ({ scene }) => {
        five.scene.add(scene);
      });

  Overrides THREEGLTFLoader.constructor

  - Defined in lib/gltf-loader/index.ts:59

## Properties

### ddsLoader

ddsLoader: DDSLoader | null

Inherited from THREEGLTFLoader.ddsLoader

- Defined in lib/gltf-loader/thirdparty/GLTFLoader.d.ts:36

### dracoLoader

dracoLoader: DRACOLoader | null

Inherited from THREEGLTFLoader.dracoLoader

- Defined in lib/gltf-loader/thirdparty/GLTFLoader.d.ts:35

## Accessors

### `Static` version

- get version(): string

  #### Returns string

  - Defined in lib/gltf-loader/index.ts:43

## Methods

### load

- load(
  url: string,
  onLoad: (gltf: GLTF) => void,
  onProgress?: (event: ProgressEvent) => void,
  onError?: (event: ErrorEvent) => void,
  ): void

  加载模型

  #### Parameters

  - url: string

    模型 URL

  - onLoad: (gltf: GLTF) => void

    加载完成回调

  - `Optional` onProgress: (event: ProgressEvent) => void

    加载进度回调

  - `Optional` onError: (event: ErrorEvent) => void

    加载错误回调

  #### Returns void

  Overrides THREEGLTFLoader.load

  - Defined in lib/gltf-loader/index.ts:72

### parse

- parse(
  data: string | ArrayBuffer,
  path: string,
  onLoad: (gltf: GLTF) => void,
  onError?: (event: ErrorEvent) => void,
  ): void

  #### Parameters

  - data: string | ArrayBuffer
  - path: string
  - onLoad: (gltf: GLTF) => void
  - `Optional` onError: (event: ErrorEvent) => void

  #### Returns void

  Overrides THREEGLTFLoader.parse

  - Defined in lib/gltf-loader/index.ts:76

### setDDSLoader

- setDDSLoader(ddsLoader: DDSLoader): THREEGLTFLoader

  #### Parameters

  - ddsLoader: DDSLoader

  #### Returns THREEGLTFLoader

  Inherited from THREEGLTFLoader.setDDSLoader

  - Defined in lib/gltf-loader/thirdparty/GLTFLoader.d.ts:40

### setDRACOLoader

- setDRACOLoader(dracoLoader: DRACOLoader): THREEGLTFLoader

  #### Parameters

  - dracoLoader: DRACOLoader

  #### Returns THREEGLTFLoader

  Inherited from THREEGLTFLoader.setDRACOLoader

  - Defined in lib/gltf-loader/thirdparty/GLTFLoader.d.ts:39