Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F626890
ParticleGenerator.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
978 B
Referenced Files
None
Subscribers
None
ParticleGenerator.h
View Options
#ifndef PARTICLE_H
#define PARTICLE_H
#include
"sfml_game/MyTools.h"
#include
<random>
class
SpriteEntity
;
class
ParticleGenerator
{
public
:
ParticleGenerator
();
void
GenerateParticles
(
int
frame
,
int
imageId
,
float
posX
,
float
posY
,
int
width
,
int
height
,
const
Vector2D
&
velocity
,
int
nOfParticles
,
float
scale
);
private
:
void
RandomizeVelocity
(
Vector2D
&
velocity
);
void
RandomizeColor
(
SpriteEntity
*
particle
);
void
RandomShuffle
(
float
&
val1
,
float
&
val2
);
void
GenerateBoltParticle
(
int
frame
,
const
Vector2D
&
velocity
,
float
posX
,
float
posY
,
float
lifeTime
,
float
scale
);
private
:
std
::
default_random_engine
randomGenerator
;
std
::
normal_distribution
<
float
>
velocityDistribution
;
std
::
normal_distribution
<
float
>
driftDistribution
;
std
::
normal_distribution
<
float
>
lifetimeDistribution
;
std
::
uniform_int_distribution
<>
sizeDistribution
;
std
::
uniform_int_distribution
<>
colorDistribution
;
std
::
uniform_int_distribution
<>
dice6Distribution
;
};
#endif
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sun, Nov 15, 1:18 AM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
112898
Default Alt Text
ParticleGenerator.h (978 B)
Attached To
Mode
R78 witchblast
Attached
Detach File
Event Timeline