B2.World:createParticleSystem: Difference between revisions

From GiderosMobile
No edit summary
m Text replacement - "</source>" to "</syntaxhighlight>"
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
<languages />
'''Available since:''' Gideros 2015.06.30<br/>
'''Available since:''' Gideros 2015.06.30<br/>
'''Class:''' [[Special:MyLanguage/b2.World|b2.World]]<br/>
'''Class:''' [[b2.World]]<br/>


=== Description ===
=== Description ===
Line 8: Line 7:


Parameters you can provide in table are:
Parameters you can provide in table are:
*"pressureStrength"
*"'''pressureStrength'''": increases pressure in response to compression. Smaller values allow more compression
*"dampingStrength"
*"'''dampingStrength'''": reduces velocity along the collision normal Smaller value reduces less
*"elasticStrength"
*"'''elasticStrength'''": restores shape of elastic particle groups. Larger values increase elastic particle velocity
*"springStrength"
*"'''springStrength'''": restores length of spring particle groups. Larger values increase spring particle velocity
*"viscousStrength"
*"'''viscousStrength'''": reduces relative velocity of viscous particles. Larger values slow down viscous particles more
*"surfaceTensionPressureStrength"
*"'''surfaceTensionPressureStrength'''": produces pressure on tensile particles 0~0.2. Larger values increase the amount of surface tension
*"surfaceTensionNormalStrength"
*"'''surfaceTensionNormalStrength'''": smoothes outline of tensile particles 0~0.2. Larger values result in rounder, smoother, water-drop-like clusters of particles
*"repulsiveStrength"
*"'''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"
*"'''powderStrength'''": produces repulsion between powder particles. Larger values repulse more
*"ejectionStrength"
*"'''ejectionStrength'''": pushes particles out of solid particle group. Larger values repulse more
*"staticPressureStrength"
*"'''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"
*"'''staticPressureRelaxation'''": reduces instability in static pressure calculation. Larger values make stabilize static pressure with fewer iterations
*"colorMixingStrength"
*"'''colorMixingStrength'''": determines how fast colors are mixed. 1.0f ==> mixed immediately 0.5f ==> mixed half way each simulation step (see [[B2.World:step]])
*"lifetimeGranularity"
*"'''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"
*"'''radius'''"
*"staticPressureIterations"
*"'''staticPressureIterations'''": computes static pressure more precisely. See SetStaticPressureIterations for details
*"destroyByAge"
*"'''destroyByAge'''": whether to destroy particles by age when no more particles can be created. See b2ParticleSystem::SetDestructionByAge() for more information
<source lang="lua">
<syntaxhighlight lang="lua">
(b2.ParticleSystem) = b2.World:createParticleSystem(particleSysDef)
(b2.ParticleSystem) = b2.World:createParticleSystem(particleSysDef)
</source>
</syntaxhighlight>


=== Parameters ===
=== Parameters ===
'''particleSysDef''': (table) parameters that define particle system <br/>
'''particleSysDef''': (table) parameters that define particle system<br/>


=== Return values ===
=== Return values ===

Latest revision as of 13: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





LiquidFun