interface Tinman.Engine.Particles.IParticleOutput

Derived from


Extended by

ParticleOutput abstract

Base interface for classes that generate GPU data for rendering particles.

When preparing a frame, the Prepare method may be called to fetch the most up-to-data particle data from the given ParticleBuffer. When rendering a frame, the Output method may be used to generate GPU data for the particles.

Public / Methods


public method CanOutput → (1)

resource in : object

The GPU resource in question.

returns → bool

true if Output can generate GPU data into resource in,
false if no GPU data can be generated.

Can the given GPU resource be used with Output?


public method Output → (2)

geometryId in : int32

The geometry identifier, see ParticleBuffer.GeometryId.

resource in : object

The GPU resource to update. If not usable (see CanOutput), this method will return 0.

returns → int32

The number of particles for which GPU data has been generated.

Generates GPU data for the particles in the given buffer, using the simulation time that has been specified by the last call to Prepare.


public method Prepare → (2)

particles in : ParticleBuffer

The particle buffer to source data from.

time opt : float64 = -1

The accumulated simulation time for which to generate GPU data, in seconds. If negative, the current buffer time will be used (see ParticleBuffer.Time).

Updates the particle output for the given simulation time.

Calling this method periodically with the same ParticleBuffer object allows an implementation to perform time-based interpolation.

Public / Attributes


public attribute Origin → (get,set)

value : Vec3D

The origin point.

The origin to use for particle position when outputting particle data with subsequent calls to Output.

The origin is subtracted from the particle position before being output as GPU data. Defaults to Vec3D.Zero.