Tweak explosion flamelets
This commit is contained in:
@@ -71,15 +71,14 @@ makeFlameExplosionAt p w =
|
||||
-- particle passes through for the first frame of its existence
|
||||
|
||||
makeExplosionAt :: Point3 -> Point3 -> World -> World
|
||||
makeExplosionAt p' vel' w =
|
||||
makeExplosionAt p vel w =
|
||||
w
|
||||
& soundStart (Explosion (w ^. cWorld . lWorld . lClock)) (p) bangS Nothing
|
||||
& soundStart (Explosion (w ^. cWorld . lWorld . lClock)) (p ^. _xy) bangS Nothing
|
||||
& addFlames
|
||||
& cWorld . lWorld . worldEvents
|
||||
.:~ MakeTempLight (LSParam (p') 150 (V3 1 0.5 0)) 20
|
||||
& makeShockwaveAt [] p' 50 50 1 white
|
||||
.:~ MakeTempLight (LSParam p 150 (V3 1 0.5 0)) 20
|
||||
& makeShockwaveAt [] p 50 50 1 white
|
||||
where
|
||||
p = p' ^. _xy
|
||||
fVs = fmap (`v2z` 0) $ replicateM 100 (randInCirc 1) & evalState $ _randGen w
|
||||
fPs' = fmap (`v2z` 0) $ replicateM 100 (randInCirc 5) & evalState $ _randGen w
|
||||
fdamps = replicateM 100 (state $ randomR (0,1)) & evalState $ _randGen w
|
||||
@@ -88,6 +87,7 @@ makeExplosionAt p' vel' w =
|
||||
sizes = randomRs (2, 9) $ _randGen w
|
||||
times = randomRs (15, 20) $ _randGen w
|
||||
mF q v damp size time = makeFlamelet
|
||||
(q - (2*v + 2* vel')) (v + damp *.*.* vel') size time
|
||||
newFs = zipWith4 (mF p') (zipWith (+) fPs' (fmap (3 *.*.*) fVs')) fdamps sizes times
|
||||
--(q - (2*v + 2* vel)) (v + damp *.*.* vel) size time
|
||||
(q - (2*v )) (v + damp *.*.* vel) size time
|
||||
newFs = zipWith4 (mF p) (zipWith (+) fPs' (fmap (3 *.*.*) fVs')) fdamps sizes times
|
||||
addFlames w' = foldl' (flip ($)) w' newFs
|
||||
|
||||
Reference in New Issue
Block a user