nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
921a5eb
)
gamnit: intro `ParticleSystem::clear`
author
Alexis Laferrière
<alexis.laf@xymus.net>
Fri, 6 Oct 2017 14:46:35 +0000
(10:46 -0400)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Tue, 21 Nov 2017 19:40:26 +0000
(14:40 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/gamnit/depth/particles.nit
patch
|
blob
|
history
diff --git
a/lib/gamnit/depth/particles.nit
b/lib/gamnit/depth/particles.nit
index
bfe3392
..
557e694
100644
(file)
--- a/
lib/gamnit/depth/particles.nit
+++ b/
lib/gamnit/depth/particles.nit
@@
-89,6
+89,16
@@
class ParticleSystem
# Time-to-live of each particle
private var ttls = new Array[Float]
+ # Clear all particles
+ fun clear
+ do
+ centers.clear
+ ots.clear
+ scales.clear
+ ttls.clear
+ total_particles = 0
+ end
+
# Add a particle at `center` with `scale`, living for `ttl` from `time_offset`
#
# `time_offset` is added to the creation time, it can be used to delay the