Fix issue #437: Area-based particle spawn.

New particles are spawned around the particle emitter position according to a
configurabe distribution.

New functionality:

particlesystem:setAreaSpread(distributon, x, y)
distribution, x, y = particlesystem:getAreaSpread()

Where `distribution' is one of "none", "uniform", "normal".
`x' and `y' take different meaning based on the distribution:

  * none:    no area spread - particles spawned at emitter position.
  * uniform: particle spawned at px,py in the rectangle around emitter
             position ex,ey, i.e.:
             ex - x < px < ex + x, ey - y < py < ey + y,
  * normal:  particle position drawn from a normal/gaussian distribution
             with mean ex,ey and standard deviation x,y, i.e.:
             px \in N(ex, x²), py \in N(ey, y²).
This commit is contained in:
vrld
2012-09-10 19:58:44 +02:00
parent 50fd169e07
commit 4ec7609d37
4 changed files with 140 additions and 11 deletions
+1 -1
View File
@@ -172,7 +172,7 @@ std::string PixelEffect::getGLSLVersion()
bool PixelEffect::isSupported()
{
return GLEE_VERSION_2_0 && GLEE_ARB_shader_objects && GLEE_ARB_fragment_shader && getGLSLVersion() >= "1.2";
return (GLEE_VERSION_2_0 || (GLEE_ARB_shader_objects && GLEE_ARB_fragment_shader)) && getGLSLVersion() >= "1.2";
}
std::string PixelEffect::getWarnings() const