UNPKG

bp-cloner

Version:

More info and explanations here - https://doc.babylonjs.com/communityExtensions/clonerSystem

40 lines (38 loc) 1.65 kB
import { Cloner } from './core'; import { Scene } from '@babylonjs/core/scene'; import { Mesh } from '@babylonjs/core/Meshes/'; /** * The ObjectCloner clones and distributes the array of given meshes to the facet position of another input mesh which acts as a template. * If more than one mesh is provided, then the corresponding clones will be placed subsequently one after another starting in the order as the facets of the template mesh is defined. * @param mesh The array of meshes/cloners to be cloned, meshes will be made inactive after construction. * @param template The mesh acting as template. * @param useInstances Flag if clones should be technical "clones" or "instances". Default true. * @param isPickable Flag true if Cloner meshes should be pickable. Default false. */ export declare class ObjectCloner extends Cloner { static instance_nr: number; private _useInstances; private _template; private _instance_nr; private _positions; private _normals; private isPickable; constructor(mesh: Array<Mesh>, template: Mesh, scene: Scene, { useInstances, isPickable }?: { useInstances?: boolean | undefined; isPickable?: boolean | undefined; }); createClones(): void; calcRot(): void; calcSize(): void; calcPos(): void; update(): void; /** * Gets Cloner's root - an invisible mesh, the anchor and parent of all generated instances/clones. * Transforming this root affects all underlying clones (childs) at once. */ get root(): Mesh | null; /** * Deletes all Cloner's children and disposes the root Node. */ delete(): void; }