Particlize

Property

Represents a property within a Frame Buffer Object (FBO) for particle data

Constructor

This class is typically not instantiated directly by users. Instead, it is created by the PropertyManager when adding a new property to a particle system. The docs for this class are provided for reference only for developers who may need to understand its structure and usage. It is used to define properties such as position, velocity, color, etc., for particles within a Frame Buffer Object FBO.

import { Property } from 'particlize-js';
new Property(name: string, size: number, defaultValue?: Float32Array, fbo?: FBO)

Parameters

ParameterTypeDescriptionDefault
namestringUnique name for the property-
sizenumberNumber of components (1-4)-
defaultValueFloat32ArrayDefault value for the propertyzero array
fboFBOThe FBO instance this property belongs to-

Properties

PropertyTypeDescription
namestringUnique identifier for the property
sizenumberNumber of components (1-4). Eg: scalars have 1, vectors have 2-4 (position(x, y, z), color(r, g, b, a), etc.)
defaultValueFloat32ArrayDefault value for new particles
fboFBOThe FBO instance this property belongs to
channelOffsetnumberChannel this property is stored in within the FBO

Methods

validate(): void

Validates the property configuration during construction.

getData(): Float32Array

Gets the current property data from the FBO.

setData(data: Float32Array): void

Sets property data in the FBO.