Class: DRACOLoader2
Asset-Management.DRACOLoader2
Hierarchy
DRACOLoader
↳
DRACOLoader2
Implements
ILoader
<BufferGeometry
,Mesh
|undefined
>
Properties
LibraryValueMap
▪ Static
LibraryValueMap: Record
<string
, any
> = {}
This is a hack to allow bundling the draco decoder js file with your app source See DRACOLoader2.SetDecoderJsString for example
Defined in
webgi/src/extras/asset_manager/importer/threejs/loaders/DRACOLoader2.ts:73
encoderPending
• encoderPending: null
| Promise
<any
> = null
Defined in
webgi/src/extras/asset_manager/importer/threejs/loaders/DRACOLoader2.ts:7
encoderConfig
• encoderConfig: any
Defined in
webgi/src/extras/asset_manager/importer/threejs/loaders/DRACOLoader2.ts:8
Methods
SetDecoderJsString
▸ Static
SetDecoderJsString(jsString
): void
Set the decoder js string Sample for how to set LibraryValueMap This is useful for bundling the draco decoder js file with your app source
example
First put the draco_decoder.js file in your src folder, then import it in js/ts as a string
import draco_decoder from './libs/draco_decoder.1.5.6.js?raw' // vite will load this as a string
// console.log(draco_decoder) // this should be a string with js content
DRACOLoader2.SetDecoderJsString(draco_decoder)
Parameters
Name | Type | Description |
---|---|---|
jsString | string | the contents of draco_decoder.js file |
Returns
void
Defined in
webgi/src/extras/asset_manager/importer/threejs/loaders/DRACOLoader2.ts:94
transform
▸ transform(res
, _
): undefined
| Mesh
<BufferGeometry
<NormalBufferAttributes
, Event
, string
>, Material
<Event
, string
> | Material
<Event
, string
>[]>
Transform after load, like convert geometry to mesh, etc. for reference see DRACOLoader2
Parameters
Name | Type |
---|---|
res | BufferGeometry <NormalBufferAttributes , Event , string > |
_ | AnyOptions |
Returns
undefined
| Mesh
<BufferGeometry
<NormalBufferAttributes
, Event
, string
>, Material
<Event
, string
> | Material
<Event
, string
>[]>
Implementation of
Defined in
webgi/src/extras/asset_manager/importer/threejs/loaders/DRACOLoader2.ts:18
preload
▸ preload(decoder?
, encoder?
): DRACOLoader
Parameters
Name | Type | Default value |
---|---|---|
decoder | boolean | true |
encoder | boolean | false |
Returns
DRACOLoader
Overrides
DRACOLoader.preload
Defined in
webgi/src/extras/asset_manager/importer/threejs/loaders/DRACOLoader2.ts:22
initEncoder
▸ initEncoder(): Promise
<any
>
Returns
Promise
<any
>
Defined in
webgi/src/extras/asset_manager/importer/threejs/loaders/DRACOLoader2.ts:28
initDecoder
▸ initDecoder(): Promise
<any
>
Returns
Promise
<any
>
Defined in
webgi/src/extras/asset_manager/importer/threejs/loaders/DRACOLoader2.ts:59
_loadLibrary
▸ _loadLibrary(url
, responseType
): Promise
<any
>
Parameters
Name | Type |
---|---|
url | string |
responseType | string |
Returns
Promise
<any
>
Overrides
DRACOLoader._loadLibrary
Defined in
webgi/src/extras/asset_manager/importer/threejs/loaders/DRACOLoader2.ts:76
Constructors
constructor
• new DRACOLoader2(manager?
)
Parameters
Name | Type |
---|---|
manager? | LoadingManager |
Overrides
DRACOLoader.constructor
Defined in
webgi/src/extras/asset_manager/importer/threejs/loaders/DRACOLoader2.ts:10