Confetti
0.1.0
A C++ particle system using Vulkan
|
An EmitterVolume that emits particles from the interior of a cone. More...
#include <Confetti/EmitterVolume.h>
Public Member Functions | |
EmitterCone (float radius, float height) | |
Constructor. More... | |
virtual | ~EmitterCone () override=default |
Destructor. | |
Overrides EmitterVolume | |
glm::vec3 | operator() (std::minstd_rand &rng) const override |
Returns a value used to specify a particle's point of emission. More... | |
Public Member Functions inherited from Confetti::EmitterVolume | |
virtual | ~EmitterVolume ()=default |
Destructor. | |
An EmitterVolume that emits particles from the interior of a cone.
The points are distributed uniformly in the volume using this function:
Given the values r and h, and the random valuest:[0,1)
,u:[0,1)
, andv:[0,1)
,x = sqrt( t ) / r * v**(1/3) * h * cos( u * TWO_PI ) y = sqrt( t ) / r * v**(1/3) * h * sin( u * TWO_PI ) z = v**(1/3) * h
Confetti::EmitterCone::EmitterCone | ( | float | radius, |
float | height | ||
) |
Constructor.
rng | Random number generator. |
radius | Radius of the cone at the base. |
height | Height of the cone. |
|
overridevirtual |
Returns a value used to specify a particle's point of emission.
rng | Random number generator. |
Implements Confetti::EmitterVolume.