Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MeshoptCompression

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:

    MeshoptCompression.Configuration = {
        decoder: {
            url: "<url to the meshopt decoder library>"
        }
    };

Hierarchy

  • MeshoptCompression

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Static ConfigurationSearch playground for Configuration

The configuration. Defaults to the following:

decoder: {
  url: "https://preview.babylonjs.com/meshopt_decoder.js"
}

Accessors

Static Default

  • Default instance for the meshoptimizer object.

    Returns MeshoptCompression

Methods

decodeGltfBufferAsync

  • decodeGltfBufferAsync(source: Uint8Array, count: number, stride: number, mode: "ATTRIBUTES" | "TRIANGLES" | "INDICES", filter?: string): Promise<Uint8Array>

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.

  • Optional filter: string

    The compression filter.

Returns Promise<Uint8Array>

a Promise that resolves to the decoded data

disposeSearch playground for dispose

  • dispose(): void
  • Stop all async operations and release resources.

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method