Particlize
Frames

Frame

Container class for particle data that can be added to or used to morph particle systems

Constructor

new Frame(options?: { particles: Particle[] })

Parameters

ParameterTypeDescriptionDefault
particlesParticle[]Array of particles to include in frame[]

Properties

PropertyTypeDescription
uuidstringUnique identifier for the frame
particlesParticle[]Array of particles contained in frame
countnumberNumber of particles in the frame
dataRecord<string, Float32Array>Processed particle data for GPU

Methods

build(propertyManager: PropertyManager): void

Processes the frame's particles and prepares data for the PropertyManager.

dispose(): void

Cleans up the frame's data and resources.

Example Usage

import { Frame, Particle } from 'particlize';

// Create particles
const particles = [
  new Particle({ position: [0, 0, 0] }),
  new Particle({ position: [1, 1, 1] }),
  new Particle({ position: [2, 2, 2] })
];

// Create frame with particles
const frame = new Frame({ particles });

// Build frame data with property manager
frame.build(propertyManager);

// Use frame data
console.log(frame.data);