Optionalmanager: LoadingManagerReadonlyisStaticDRACO_Path to the draco decoder/encoder libraries, default uses jsdelivr CDN You may want to set this to your own path or use DRACOLoader2.SetDecoderJsString to bundle the draco decoder js file with your app source
StaticLibraryThis is a hack to allow bundling the draco decoder js file with your app source See DRACOLoader2.SetDecoderJsString for example
Transform after load, like convert geometry to mesh, etc. for reference see DRACOLoader2 or PLYLoadPlugin
result of load
StaticSetSet the decoder js string (JS-only build) Sample for how to set LibraryValueMap This is useful for bundling the draco decoder js file with your app source
If you bundle only the JS build (no wasm), also call dracoLoader.setDecoderConfig({type: 'js'})
on the instance (or the wasm fetch will be attempted and fail). Alternatively use
DRACOLoader2.SetDecoderWasmBinary to bundle the wasm build instead.
the contents of draco_decoder.js file
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)
StaticSetSet the decoder wasm wrapper js + wasm binary (WASM build) This is useful for bundling the draco wasm decoder with your app source instead of fetching from CDN.
the contents of draco_wasm_wrapper.js file (string)
the contents of draco_decoder.wasm file (ArrayBuffer)
Encoder config — defaults to JS-only build because the default CDN path (DRACOLoader2.DRACO_LIBRARY_PATH, i.e. google/draco's javascript folder) ships only
draco_encoder.js, notdraco_encoder.wasm. Override to{}(auto-detect) or{type: 'wasm'}only if your decoder path hostsdraco_encoder.wasm(e.g. draco3dgltf npm package).