IParticleOutput

Description

interface Tinman.Engine.Particles.IParticleOutput

Derived from

ICapacity
IResourceHandle

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

Can​Output


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?

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.

Prepare


public method Prepare → (2)

particles in : ParticleBuffer

[not-null]
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

Origin


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.