@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.
122 lines (121 loc) • 4.36 kB
TypeScript
import { ParticleSystemSet } from "../particleSystemSet.js";
import { SystemBlock } from "./Blocks/systemBlock.js";
import type { Scene } from "../../scene.js";
import type { NodeParticleBlock } from "./nodeParticleBlock.js";
import { Observable } from "../../Misc/observable.js";
import { ParticleInputBlock } from "./Blocks/particleInputBlock.js";
/**
* Defines a set of particle systems defined as a node graph.
* @experimental This API is experimental and may change in future releases.
* NPE: #K6F1ZB#1
* PG: #ZT509U#1
*/
export declare class NodeParticleSystemSet {
private _systemBlocks;
private _buildId;
/** Define the Url to load node editor script */
static EditorURL: string;
/** Define the Url to load snippets */
static SnippetUrl: string;
/**
* Snippet ID if the material was created from the snippet server
*/
snippetId: string;
/**
* Gets an array of blocks that needs to be serialized even if they are not yet connected
*/
attachedBlocks: NodeParticleBlock[];
/**
* Gets or sets data used by visual editor
* @see https://npe.babylonjs.com
*/
editorData: any;
/**
* Observable raised when the particle set is built
*/
onBuildObservable: Observable<NodeParticleSystemSet>;
/**
* The name of the set
*/
name: string;
/**
* A free comment about the set
*/
comment: string;
/**
* Gets the system blocks
*/
get systemBlocks(): SystemBlock[];
/**
* Gets the list of input blocks attached to this material
* @returns an array of InputBlocks
*/
get inputBlocks(): ParticleInputBlock[];
/**
* Creates a new set
* @param name defines the name of the set
*/
constructor(name: string);
/**
* Gets the current class name of the geometry e.g. "NodeParticleSystemSet"
* @returns the class name
*/
getClassName(): string;
private _initializeBlock;
/**
* Builds the particle system set from the defined blocks.
* @param scene defines the hosting scene
* @param verbose defines whether to log detailed information during the build process (false by default)
* @returns a promise that resolves to the built particle system set
*/
buildAsync(scene: Scene, verbose?: boolean): Promise<ParticleSystemSet>;
/**
* Clear the current geometry
*/
clear(): void;
/**
* Clear the current set and restore it to a default state
*/
setToDefault(): void;
/**
* Remove a block from the current system set
* @param block defines the block to remove
*/
removeBlock(block: NodeParticleBlock): void;
/**
* Clear the current graph and load a new one from a serialization object
* @param source defines the JSON representation of the particle set
* @param merge defines whether or not the source must be merged or replace the current content
*/
parseSerializedObject(source: any, merge?: boolean): void;
private _restoreConnections;
/**
* Serializes this geometry in a JSON representation
* @param selectedBlocks defines the list of blocks to save (if null the whole geometry will be saved)
* @returns the serialized geometry object
*/
serialize(selectedBlocks?: NodeParticleBlock[]): any;
/**
* Disposes the resources
*/
dispose(): void;
/**
* Creates a new node particle set set to default basic configuration
* @param name defines the name of the particle set
* @returns a new NodeParticleSystemSet
*/
static CreateDefault(name: string): NodeParticleSystemSet;
/**
* Creates a node particle set from parsed data
* @param source defines the JSON representation of the particle set
* @returns a new node particle set
*/
static Parse(source: any): NodeParticleSystemSet;
/**
* Creates a node particle set from a snippet saved by the node geometry editor
* @param snippetId defines the snippet to load
* @param nodeParticleSet defines a node particle set to update (instead of creating a new one)
* @returns a promise that will resolve to the new node geometry
*/
static ParseFromSnippetAsync(snippetId: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet>;
}