Most visited

Recently visited

FixedParticleEmitter

public class FixedParticleEmitter
extends Object

java.lang.Object
   ↳ com.viro.core.FixedParticleEmitter


FixedParticleEmitter enables you to render groups of fixed particles. The particles do not naturally move: they stay fixed in place until you manually change their position. This is useful for rendering large numbers of identical small objects, like point clouds.

Summary

Public constructors

FixedParticleEmitter(ViroContext viroContext, Surface surface)

Create a new FixedParticleEmitter where each particle is modeled after the provided Surface.

Public methods

void clearParticles()

Clears all particles currently being rendered by this emitter.

void dispose()

Release native resources associated with this FixedParticleEmitter.

void setParticles(List<Vector> positions)

Set the list of positions at which to render particles.

void setSurface(Surface surface)

Set a new Surface to redefine the appearance of each particle in this emitter.

Public constructors

FixedParticleEmitter

FixedParticleEmitter (ViroContext viroContext, 
                Surface surface)

Create a new FixedParticleEmitter where each particle is modeled after the provided Surface. To be used, the positions of each particle must be set with setParticles(List), and the FixedParticleEmitter must be added to a Node through setFixedParticleEmitter(FixedParticleEmitter).

Note that a node can only contain either a FixedParticleEmitter or a ParticleEmitter at any given point in time, not both (any existing emitters will be unset before a new emitter becomes active).

The FixedParticleEmitter will conform to all the transforms of its parent Node, meaning it can be moved and oriented with the scene graph.

Parameters
viroContext ViroContext: The ViroContext is required to generate particles.

surface Surface: Surface representing how each individual particle should appear. The Surface may be textured as well. If none is provided, a default surface is used.

Public methods

clearParticles

void clearParticles ()

Clears all particles currently being rendered by this emitter.

dispose

void dispose ()

Release native resources associated with this FixedParticleEmitter.

setParticles

void setParticles (List<Vector> positions)

Set the list of positions at which to render particles. Each particle will appear identical to the Surface used by this FixedParticleEmitter. Any existing particles rendered by this FixedParticleEmitter will be removed and replaced by these new particles.

Parameters
positions List: List of positions at which to render particles.

setSurface

void setSurface (Surface surface)

Set a new Surface to redefine the appearance of each particle in this emitter.

Parameters
surface Surface

Hooray!