Fix bug in randArc
This commit is contained in:
@@ -19,17 +19,18 @@ makeBlockDebris :: Block -> World -> World
|
||||
makeBlockDebris bl = makeDebris (greyN 0.5) (_blMaterial bl) (_blPos bl)
|
||||
|
||||
makeDebris :: Color -> BlockMaterial -> Point2 -> World -> World
|
||||
makeDebris = makeDebrisDirected (2*pi) 0
|
||||
makeDebris = makeDebrisDirected 1 2 (2*pi) 0
|
||||
|
||||
makeDebrisDirected :: Float -> Float -> Color -> BlockMaterial -> Point2 -> World -> World
|
||||
makeDebrisDirected arcrad dir col bm p w = w
|
||||
makeDebrisDirected :: Float -> Float
|
||||
-> Float -> Float -> Color -> BlockMaterial -> Point2 -> World -> World
|
||||
makeDebrisDirected mindist maxdist arcrad dir col bm p w = w
|
||||
& flip (foldr (plNew props pjID)) thedebris
|
||||
& randGen .~ newg
|
||||
& matDesSound bm p
|
||||
where
|
||||
(thedebris,newg) = runState (mapM f [35,55..95]) $ _randGen w
|
||||
f h = do
|
||||
v <- rotateV (dir - arcrad/2) <$> randInArcStrip 2 3 arcrad
|
||||
v <- rotateV (dir - arcrad/2) <$> randInArcStrip mindist maxdist arcrad
|
||||
q <- Q.vToQuat (V3 0 0 1) <$> randOnUnitSphere
|
||||
return $ someDebris
|
||||
& prPos .~ p
|
||||
|
||||
Reference in New Issue
Block a user