Class MeshoptCompression
Implements
Constructors
constructor
-
Constructor
Returns MeshoptCompression
Properties
StaticConfiguration
The configuration. Defaults to the following:
decoder: {
url: "https://cdn.babylonjs.com/meshopt_decoder.js"
}
Accessors
StaticDefault
-
Default instance for the meshoptimizer object.
Returns MeshoptCompression
Methods
decode Gltf Buffer Async
decodeGltfBufferAsync(
source: Uint8Array,
count: number,
stride: number,
mode: "ATTRIBUTES" | "TRIANGLES" | "INDICES",
filter?: string,
): Promise<Uint8Array<ArrayBufferLike>>
source: Uint8Array,
count: number,
stride: number,
mode: "ATTRIBUTES" | "TRIANGLES" | "INDICES",
filter?: string,
): Promise<Uint8Array<ArrayBufferLike>>
Decode meshopt data.
Parameters
- source: Uint8Array
The input data.
- count: number
The number of elements.
- stride: number
The stride in bytes.
- mode: "ATTRIBUTES" | "TRIANGLES" | "INDICES"
The compression mode.
Optionalfilter: stringThe compression filter.
Returns Promise<Uint8Array<ArrayBufferLike>>
a Promise that resolves to the decoded datadispose
-
Stop all async operations and release resources.
Returns void
Meshopt compression (https://github.com/zeux/meshoptimizer)
This class wraps the meshopt library from https://github.com/zeux/meshoptimizer/tree/master/js.
Encoder
The encoder is not currently implemented.
Decoder
By default, the configuration points to a copy of the meshopt files on the Babylon.js preview CDN (e.g. https://preview.babylonjs.com/meshopt_decoder.js).
To update the configuration, use the following code: