UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

183 lines 5.32 kB
export class ParticleGroup { /** * * @param {ParticleSpecification} spec * @param {boolean} [instanced=false] * @constructor */ constructor(spec: ParticleSpecification, instanced?: boolean); instanced: boolean; /** * * @type {ParticleSpecification} */ spec: ParticleSpecification; attributes: any[]; /** * * @type {ObservedValue<BufferGeometry>} */ geometry: any; /** * * @type {int} */ size: int; /** * * @type {int} */ capacity: int; growFactor: number; shrinkFactor: number; referenceIndexLookup: Map<any, any>; indexReferenceLookup: any[]; /** * * @type {Array.<Operation>} */ commandQueue: Array<Operation>; referencePool: IdPool; /** * * @param {Float64Array|Float32Array|Uint32Array|Uint16Array|Uint8Array|Int32Array|Int16Array|Int8Array} array * @param {int} itemSize * @returns {InstancedBufferAttribute|BufferAttribute} */ buildNewBufferAttribute(array: Float64Array | Float32Array | Uint32Array | Uint16Array | Uint8Array | Int32Array | Int16Array | Int8Array, itemSize: int): InstancedBufferAttribute | BufferAttribute; /** * * @returns {InstancedBufferGeometry|BufferGeometry} */ buildNewGeometry(): InstancedBufferGeometry | BufferGeometry; build(): void; /** * attributes can not grow, this means that we need to rebuild entire geometry if we want to make that happen */ setCapacity(maxSize: any): void; reset(): void; /** * Flush command queue * @returns {boolean} true if some operations were executed, false otherwise */ update(): boolean; optimizeCommandQueue(): void; /** * * @param {number} id */ createSpecific(id: number): void; /** * NOTE: Deferred operation, required update before results can be observed * @returns {number} particle reference */ create(): number; /** * NOTE: Deferred operation, required update before results can be observed */ remove(reference: any): void; /** * NOTE: this method does not take pending operations into account * @param reference */ contains(reference: any): boolean; traverseReferences(visitor: any): void; /** * NOTE: Deferred operation, required update before results can be observed * @param {int} reference * @param {int} attributeIndex Index of attribute to be written * @param {Array.<number>} value */ writeAttribute(reference: int, attributeIndex: int, value: Array<number>): void; /** * * @param {number} index * @param {number} attributeIndex * @param {Array|Float32Array|Float64Array|Uint8Array} result */ readAttributeByIndex(index: number, attributeIndex: number, result: any[] | Float32Array | Float64Array | Uint8Array): void; readAttribute(reference: any, attributeIndex: any, result: any): void; /** * Produces reference of a particle by its index * @param {number} index * @returns {number} */ referenceByIndex(index: number): number; createImmediate(): number; executeOperationAdd(references: any): void; executeOperationRemove(references: any): void; /** * * @param reference * @param attributeIndex * @param {number[]} value */ executeOperationWriteAttribute(reference: any, attributeIndex: any, value: number[]): void; /** * * @param reference * @param attributeIndex * @param {number} value */ executeOperationWriteAttribute_Scalar(reference: any, attributeIndex: any, value: number): void; /** * * @param reference * @param attributeIndex * @param x * @param y * @param z */ executeOperationWriteAttribute_Vector3(reference: any, attributeIndex: any, x: any, y: any, z: any): void; /** * * @param reference * @param attributeIndex * @param x * @param y * @param z * @param w */ executeOperationWriteAttribute_Vector4(reference: any, attributeIndex: any, x: any, y: any, z: any, w: any): void; /** * * @param {Operation} operation */ executeOperation(operation: Operation): void; /** * * @param {Array.<int>} indices */ deleteIndices(indices: Array<int>): void; /** * Swap two particles identified by index * @param {number} indexA * @param {number} indexB */ swapAttributeValues(indexA: number, indexB: number): void; /** * * @param {number} indexA * @param {number} indexB */ swap(indexA: number, indexB: number): void; /** * * @param {int} numAdded */ grow(numAdded: int): void; preAllocate(itemCount: any): void; updateCapacity(newSize: any): void; /** * * @param {int} newSize */ setSize(newSize: int): void; } import { Operation } from "./Operation.js"; import IdPool from "../../../../../core/IdPool.js"; import { InstancedBufferAttribute } from "three"; import { BufferAttribute } from "three"; import { InstancedBufferGeometry } from "three"; import { BufferGeometry } from "three"; //# sourceMappingURL=ParticleGroup.d.ts.map