Difference between revisions of "B2.World:createParticleSystem"
From GiderosMobile
(more info) |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
(One intermediate revision by the same user not shown) | |||
Line 24: | Line 24: | ||
*"'''staticPressureIterations'''": computes static pressure more precisely. See SetStaticPressureIterations for details | *"'''staticPressureIterations'''": computes static pressure more precisely. See SetStaticPressureIterations for details | ||
*"'''destroyByAge'''": whether to destroy particles by age when no more particles can be created. See b2ParticleSystem::SetDestructionByAge() for more information | *"'''destroyByAge'''": whether to destroy particles by age when no more particles can be created. See b2ParticleSystem::SetDestructionByAge() for more information | ||
− | < | + | <syntaxhighlight lang="lua"> |
(b2.ParticleSystem) = b2.World:createParticleSystem(particleSysDef) | (b2.ParticleSystem) = b2.World:createParticleSystem(particleSysDef) | ||
− | </ | + | </syntaxhighlight> |
=== Parameters === | === Parameters === |
Latest revision as of 14:27, 13 July 2023
Available since: Gideros 2015.06.30
Class: b2.World
Description
Creates a new particle system, which will use Liquid fun.
Parameters you can provide in table are:
- "pressureStrength": increases pressure in response to compression. Smaller values allow more compression
- "dampingStrength": reduces velocity along the collision normal Smaller value reduces less
- "elasticStrength": restores shape of elastic particle groups. Larger values increase elastic particle velocity
- "springStrength": restores length of spring particle groups. Larger values increase spring particle velocity
- "viscousStrength": reduces relative velocity of viscous particles. Larger values slow down viscous particles more
- "surfaceTensionPressureStrength": produces pressure on tensile particles 0~0.2. Larger values increase the amount of surface tension
- "surfaceTensionNormalStrength": smoothes outline of tensile particles 0~0.2. Larger values result in rounder, smoother, water-drop-like clusters of particles
- "repulsiveStrength": produces additional pressure on repulsive particles. Larger values repulse more. Negative values mean attraction. The range where particles behave stably is about -0.2 to 2.0
- "powderStrength": produces repulsion between powder particles. Larger values repulse more
- "ejectionStrength": pushes particles out of solid particle group. Larger values repulse more
- "staticPressureStrength": produces static pressure. Larger values increase the pressure on neighboring partilces. For a description of static pressure, see http://en.wikipedia.org/wiki/Static_pressure#Static_pressure_in_fluid_dynamics
- "staticPressureRelaxation": reduces instability in static pressure calculation. Larger values make stabilize static pressure with fewer iterations
- "colorMixingStrength": determines how fast colors are mixed. 1.0f ==> mixed immediately 0.5f ==> mixed half way each simulation step (see B2.World:step)
- "lifetimeGranularity": granularity of particle lifetimes in seconds. By default this is set to (1.0f / 60.0f) seconds. b2ParticleSystem uses a 32-bit signed value to track particle lifetimes so the maximum lifetime of a particle is (2^32 - 1) / (1.0f / lifetimeGranularity) seconds. With the value set to 1/60 the maximum lifetime or age of a particle is 2.27 years
- "radius"
- "staticPressureIterations": computes static pressure more precisely. See SetStaticPressureIterations for details
- "destroyByAge": whether to destroy particles by age when no more particles can be created. See b2ParticleSystem::SetDestructionByAge() for more information
(b2.ParticleSystem) = b2.World:createParticleSystem(particleSysDef)
Parameters
particleSysDef: (table) parameters that define particle system
Return values
Returns (b2.ParticleSystem) new particle system