Particles

A structure that maintains all ParticleData array for the active set of Particles. This API allows you to gain access to the raw data used by the particles and allows you to change them using a Script or via C/C++ plugins.

See Also

Static Variables


Name Description
type Active ParticleType use by the active Particles.
entity The current Entity connected to the Particles (kMatter only).
playback_time Total playback time of the Particles since their creation.
count Total amount of Particles available.
active Current amount of active Particles.
data_count Amount of ParticleDataType available within the active Particles.
duration Duration data array.
lifetime Lifetime data array.
size Size data array.
rotation Rotation data array.
scale Scale data array.
color0 First color channel data array.
color1 Second color channel data array.
color2 Third color channel data array.
color3 Fourth color channel data array.
alpha0 First alpha channel data array.
alpha1 Second alpha channel data array.
alpha2 Third alpha channel data array.
alpha3 Fourth alpha channel data array.
userdata0 First userdata channel data array.
userdata1 Second userdata channel data array.
userdata2 Third userdata channel data array.
userdata3 Fourth userdata channel data array.
velocity Velocity data array.
force Force data array.
angle Force data array.
offset Offset data array.
texcoord0 First texcoord channel data array.
texcoord1 Second texcoord channel data array.
texcoord2 Third texcoord channel data array.
texcoord3 Fourth texcoord channel data array.
basis_matrix Local transformation data array.
world_matrix World transformation data array.

Variables


Name Description
sync_time Last time the Particles was re-evaluated.

Functions


Name Description
GetParticleDataType Retrieve the ParticleDataType for a specific data index.

ParticleType


Constant values that identify the different types of Particles

  • kSprite: Quads; their sizes are not implementation limited and rotation can be applied. They are constructed using two triangles and takes 4 vectors per particle in memory.
  • kPointSprite: Points; they are the fastest type to render and takes little memory (1 vector per particles). However, their size is restricted by the maximum point size of the graphics implementation (which may vary from platform to platform). In addition, they can only have the same size on the X and Y axis and cannot be rotated.
  • kTrail: Stitched quads; very similar to Sprite the trail allows you to created lines since all particles emitted will connect to the next using a triangle strip. They are ideal to create effects such as lighting, electricity or motion trails.
  • kMatter: This type allows you to connect an existing Entity. An Entity is basically a predefined branch (including leaves if any) of the scene graph that has been saved as a Script. Every time a particle will be emitted the Script will run creating a new Object or series of objects and reconstruct their properties (physics included).

Scripting


Access and modify a specific type of Particles data from a Script.

  • Lua
-- Retrieve the ParticleDataType at index 0 and insure it is of the
-- type kDuration.
if( this.data.particlesystem:GetParticlesAt(0):GetParticleDataType(0) ==
    ParticleData.ParticleDataType.kDurationData ) then
-- Retrieve the duration array. local duration = this.data.particlesystem:GetParticlesAt(0).duration -- Update the duration data for each particle. for i=1,table.getn( duration ) do duration[ i ] = duration[ i ] * 1.125 end
-- Push back the updated duration data. this.data.particlesystem:GetParticlesAt(0).duration = duration end




NRG - API 2022.4.384543 - Fri Nov 4 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA