Difference between revisions of "B2.World:createParticleSystem"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2015.06.30<br/>
+
'''Available since:''' Gideros 2015.06.30<br/>
=== <translate>Description</translate> ===
+
'''Class:''' [[b2.World]]<br/>
<translate>Creats new particle system, which will use Liquid fun.
+
 
Parameters that you can provide in table:
+
=== Description ===
"pressureStrength",
+
Creates a new particle system, which will use Liquid fun.
"dampingStrength",
+
 
"elaticStrength",
+
Parameters you can provide in table are:
"springStrength",
+
*"'''pressureStrength'''": increases pressure in response to compression. Smaller values allow more compression
"viscousStrength",
+
*"'''dampingStrength'''": reduces velocity along the collision normal Smaller value reduces less
"surfaceTensionPressureStrength",
+
*"'''elasticStrength'''": restores shape of elastic particle groups. Larger values increase elastic particle velocity
"surfaceTensionNormalStrength",  
+
*"'''springStrength'''": restores length of spring particle groups. Larger values increase spring particle velocity
"repulsiveStrength",
+
*"'''viscousStrength'''": reduces relative velocity of viscous particles. Larger values slow down viscous particles more
"powderStrength",
+
*"'''surfaceTensionPressureStrength'''": produces pressure on tensile particles 0~0.2. Larger values increase the amount of surface tension
"ejectionStrength",
+
*"'''surfaceTensionNormalStrength'''": smoothes outline of tensile particles 0~0.2. Larger values result in rounder, smoother, water-drop-like clusters of particles
"staticPressureStrength",  
+
*"'''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
"staticPressureRelaxation",
+
*"'''powderStrength'''": produces repulsion between powder particles. Larger values repulse more
"colorMixingStrength",
+
*"'''ejectionStrength'''": pushes particles out of solid particle group. Larger values repulse more
"lifetimeGranularity",
+
*"'''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
"radius",
+
*"'''staticPressureRelaxation'''": reduces instability in static pressure calculation. Larger values make stabilize static pressure with fewer iterations
"staticPressureIterations",
+
*"'''colorMixingStrength'''": determines how fast colors are mixed. 1.0f ==> mixed immediately 0.5f ==> mixed half way each simulation step (see [[B2.World:step]])
"destroyByAge"</translate>
+
*"'''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
<source lang="lua">
+
*"'''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
 +
<syntaxhighlight lang="lua">
 
(b2.ParticleSystem) = b2.World:createParticleSystem(particleSysDef)
 
(b2.ParticleSystem) = b2.World:createParticleSystem(particleSysDef)
</source>
+
</syntaxhighlight>
=== <translate>Parameters</translate> ===
+
 
'''particleSysDef''': (table) <translate>parameters that define particle system</translate> <br/>
+
=== Parameters ===
=== <translate>Return values</translate> ===
+
'''particleSysDef''': (table) parameters that define particle system<br/>
'''<translate>Returns</translate>''' (b2.ParticleSystem) <translate>new particle system</translate><br/>
+
 
 +
=== Return values ===
 +
'''Returns''' (b2.ParticleSystem) new particle system<br/>
 +
 
 +
{{B2.World}}

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





LiquidFun