Difference between revisions of "B2.World:createParticleSystem"

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