# new GLTF()
- Source:
Extends
Members
# __uid__ :number
- Source:
- Inherited From:
Type:
- number
# bufferRootPath :string
- Source:
Root path for buffer uri parsing. Defaultly use the rootPath
Type:
- string
# crossOrigin :string
- Source:
Type:
- string
# includeAnimation :boolean
- Source:
If loading the animations.
Type:
- boolean
# includeCamera :boolean
- Source:
If loading the cameras.
Type:
- boolean
# includeMesh :boolean
- Source:
If loading the meshes
Type:
- boolean
# includeTexture :boolean
- Source:
If loading the textures.
Type:
- boolean
# rootNode :clay.Node
- Source:
Type:
# rootPath :string
- Source:
Root path for uri parsing.
Type:
- string
# shader :string|clay.Shader
- Source:
- Default Value:
- 'clay.standard'
Shader used when creating the materials.
Type:
- string | clay.Shader
# textureConvertToPOT :boolean
- Source:
If convert texture to power-of-two
Type:
- boolean
# textureFlipY :boolean
Type:
- boolean
# textureRootPath :string
- Source:
Root path for texture uri parsing. Defaultly use the rootPath
Type:
- string
# useStandardMaterial :string
- Source:
If use clay.StandardMaterial
Type:
- string
Methods
# after(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of once('after' + name)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
action |
function | ||
context |
Object |
<optional> |
# before(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of once('before' + name)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
action |
function | ||
context |
Object |
<optional> |
# error(action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of on('error')
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
function | ||
context |
Object |
<optional> |
# has(name, action) → {boolean}
- Source:
- Inherited From:
- Mixes In:
If registered the event handler
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
action |
function |
Returns:
- Type
- boolean
# load(url)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
url |
string |
# loadBuffer(onsuccess, onerror)
- Source:
Buffer loader
Parameters:
Name | Type | Description |
---|---|---|
|
string | |
onsuccess |
function | |
onerror |
function |
# off(action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Remove event listener
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
function | ||
context |
Object |
<optional> |
# on(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Register event handler
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
action |
function | ||
context |
Object |
<optional> |
# once(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Register event, event will only be triggered once and then removed
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
action |
function | ||
context |
Object |
<optional> |
# parse(json, bufferopt) → {clay.loader.GLTF.Result}
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
json |
Object | ||
buffer |
Array.<ArrayBuffer> |
<optional> |
Returns:
# parseBinary(buffer) → {clay.loader.GLTF.Result}
- Source:
Parse glTF binary
Parameters:
Name | Type | Description |
---|---|---|
buffer |
ArrayBuffer |
Returns:
# resolveBufferPath(path)
- Source:
Binary file path resolver. User can override it
Parameters:
Name | Type | Description |
---|---|---|
path |
string |
# resolveTexturePath(path)
- Source:
Texture file path resolver. User can override it
Parameters:
Name | Type | Description |
---|---|---|
path |
string |
# success(action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of on('success')
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
function | ||
context |
Object |
<optional> |
# trigger(name)
- Source:
- Inherited From:
- Mixes In:
Trigger event
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
Type Definitions
# Result
- Source:
Properties:
Name | Type | Description |
---|---|---|
json |
Object | |
scene |
clay.Scene | |
rootNode |
clay.Node | |
cameras |
Array.<clay.Camera> | |
textures |
Array.<clay.Texture> | |
materials |
Array.<clay.Material> | |
skeletons |
Array.<clay.Skeleton> | |
meshes |
Array.<clay.Mesh> | |
clips |
Array.<clay.animation.TrackClip> | |
nodes |
Array.<clay.Node> |
Type:
- Object