Skip to content

Latest commit

 

History

History
292 lines (157 loc) · 5.02 KB

GlTFPreview.md

File metadata and controls

292 lines (157 loc) · 5.02 KB

@galacean/asset-tools / Exports / GlTFPreview

Class: GlTFPreview

Table of contents

Properties

Accessors

Methods

Properties

canvas

Readonly canvas: HTMLCanvasElement

Get the current canvas element.

Defined in

gltf/GlTFPreview.ts:35

Accessors

animationNames

get animationNames(): string[]

Get the current animation names.

Returns

string[]

Defined in

gltf/GlTFPreview.ts:40


duration

get duration(): number

Get the current duration.

Returns

number

Defined in

gltf/GlTFPreview.ts:47


frameTime

get frameTime(): number

Get the current frame time.

Returns

number

Defined in

gltf/GlTFPreview.ts:54


isPlaying

get isPlaying(): boolean

Get the current playing state.

Returns

boolean

Defined in

gltf/GlTFPreview.ts:61

Methods

destroy

destroy(): void

Destroy glTF preview

Returns

void

Defined in

gltf/GlTFPreview.ts:208


getSnapshot

getSnapshot(width?, height?): Promise<unknown>

Get snapshot of the glTF

Parameters

Name Type Default value Description
width number 500 snapshot width
height number 500 snapshot height

Returns

Promise<unknown>

  • promise of snapshot base64 url

Defined in

gltf/GlTFPreview.ts:219


loadAsset

loadAsset(glTFAsset): Promise<void>

Load glTF asset

Parameters

Name Type Description
glTFAsset string | Blob glTF asset url or blob

Returns

Promise<void>

async promise

Defined in

gltf/GlTFPreview.ts:113


pauseAnimation

pauseAnimation(): void

Pause animation

Returns

void

Defined in

gltf/GlTFPreview.ts:201


playAnimation

playAnimation(): void

Play animation

Returns

void

Defined in

gltf/GlTFPreview.ts:191


selectAnimation

selectAnimation(index): void

Select animation

Parameters

Name Type Description
index number animation index

Returns

void

Defined in

gltf/GlTFPreview.ts:167


setFrameTime

setFrameTime(frameTime): void

Set frame time

Parameters

Name Type Description
frameTime number frame time

Returns

void

Defined in

gltf/GlTFPreview.ts:180


startPreview

startPreview(): void

Start preview glTF asset

Returns

void

Defined in

gltf/GlTFPreview.ts:132


stopPreview

stopPreview(): void

Stop preview glTF asset

Returns

void

Defined in

gltf/GlTFPreview.ts:155


getInstance

Static getInstance(): GlTFPreview

Returns

GlTFPreview

Defined in

gltf/GlTFPreview.ts:25