@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
63 lines (62 loc) • 2.47 kB
TypeScript
import { Scene } from "../scene.js";
import type { ISimplificationSettings } from "./meshSimplification.js";
import { SimplificationQueue, SimplificationType } from "./meshSimplification.js";
import type { ISceneComponent } from "../sceneComponent.js";
declare module "../scene.js" {
interface Scene {
/** @internal (Backing field) */
_simplificationQueue: SimplificationQueue;
/**
* Gets or sets the simplification queue attached to the scene
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/simplifyingMeshes
*/
simplificationQueue: SimplificationQueue;
}
}
declare module "../Meshes/mesh.js" {
interface Mesh {
/**
* Simplify the mesh according to the given array of settings.
* Function will return immediately and will simplify async
* @param settings a collection of simplification settings
* @param parallelProcessing should all levels calculate parallel or one after the other
* @param simplificationType the type of simplification to run
* @param successCallback optional success callback to be called after the simplification finished processing all settings
* @returns the current mesh
*/
simplify(settings: Array<ISimplificationSettings>, parallelProcessing?: boolean, simplificationType?: SimplificationType, successCallback?: (mesh?: Mesh, submeshIndex?: number) => void): Mesh;
}
}
/**
* Defines the simplification queue scene component responsible to help scheduling the various simplification task
* created in a scene
*/
export declare class SimplicationQueueSceneComponent implements ISceneComponent {
/**
* The component name helpfull to identify the component in the list of scene components.
*/
readonly name = "SimplificationQueue";
/**
* The scene the component belongs to.
*/
scene: Scene;
/**
* Creates a new instance of the component for the given scene
* @param scene Defines the scene to register the component in
*/
constructor(scene: Scene);
/**
* Registers the component in a given scene
*/
register(): void;
/**
* Rebuilds the elements related to this component in case of
* context lost for instance.
*/
rebuild(): void;
/**
* Disposes the component and the associated resources
*/
dispose(): void;
private _beforeCameraUpdate;
}