# Class: GLTFModel

加载完毕的GLTF模型，可以在节点下创建[GLTF组件](GLTF)来将其实例化。

## Table of contents

### Constructors

- constructor

### Properties

- jsonRaw

### Methods

- createFromBuffer

## Constructors

### constructor

• **new GLTFModel**(`_scene`, `model`)

#### Parameters

| Name | Type |
| :------ | :------ |
| `_scene` | [`Scene`](Scene) |
| `model` | `GLTFRootLoaded` |

## Properties

### jsonRaw

• `Readonly` **jsonRaw**: `object`

如果IGLTFLoaderOptions里开启了preserveRaw，则会将原始json保存下来。

## Methods

### createFromBuffer

▸ `Static` **createFromBuffer**(`scene`, `buffer`, `options`): `Promise`

使用GLB文件加载而成的buffer，来生成GLTF模型。

#### Parameters

| Name | Type |
| :------ | :------ |
| `scene` | [`Scene`](Scene) |
| `buffer` | `ArrayBuffer` |
| `options` | [`IGLTFLoaderOptions`](/miniprogram/dev/reference/xr-frame/api/interfaces/IGLTFLoaderOptions) |

#### Returns

`Promise`
