Particle Systems
rooomSpaces Viewer API particle system controls for dynamic virtual environments. Manage particle effects, emissions, animations, and environmental atmosphere in 3D spaces.
setParticleUpdateSpeed
setParticleUpdateSpeed(meshId: string, updateSpeed: number, [callback: Function])
Controls the update frequency of a particle system, affecting how smoothly particles animate and move. Higher values create smoother animations but may impact performance.
Parameters:
meshId: string- ID of the emitter object (found via getNodeList)updateSpeed: number- Target update speed multiplier (1.0 = normal, 2.0 = double speed)
// Increase particle animation smoothness
api.setParticleUpdateSpeed('smoke_emitter_01', 2.0, function() {
console.log('Particle update speed increased for smoother animation');
});
// Reduce update speed for performance optimization
api.setParticleUpdateSpeed('rain_system', 0.5, function() {
console.log('Particle update speed reduced to save performance');
});setParticleEmitRate
setParticleEmitRate(meshId: string, emitRate: number, [callback: Function])
Controls how many particles are emitted per second, directly affecting the density and intensity of the particle effect.
Parameters:
meshId: string- ID of the emitter object (found via getNodeList)emitRate: number- Number of particles emitted per second
// Create intense fire effect
api.setParticleEmitRate('fire_emitter', 100, function() {
console.log('Fire particle emission increased for dramatic effect');
});
// Create subtle ambient effect
api.setParticleEmitRate('dust_particles', 5, function() {
console.log('Dust particle emission set to subtle level');
});stopParticleSystem
stopParticleSystem(meshId: string, [callback: Function])
Stops a particle system completely, ceasing all particle emission and animation. Existing particles will fade out naturally.
Parameters:
meshId: string- ID of the emitter object (found via getNodeList)
api.stopParticleSystem('snow_system', function() {
console.log('Snow particle system stopped');
});startParticleSystem
startParticleSystem(meshId: string, [callback: Function])
Starts or restarts a particle system, beginning particle emission and animation effects.
Parameters:
meshId: string- ID of the emitter object (found via getNodeList)
api.startParticleSystem('magic_sparkles', function() {
console.log('Particle system started');
});