Work on bouncing debris
This commit is contained in:
+7
-15
@@ -4,6 +4,8 @@ module Dodge.Prop.Draw (
|
||||
debrisSPic,
|
||||
) where
|
||||
|
||||
import Dodge.Material.Color
|
||||
import Dodge.Block.Debris
|
||||
import Control.Lens
|
||||
import Dodge.Data.Prop
|
||||
import Geometry.Data
|
||||
@@ -19,7 +21,8 @@ propSPic pr = drawProp (_prDraw pr) pr
|
||||
debrisSPic :: Debris -> SPic
|
||||
debrisSPic db = translateSP (_dbPos db) . overPosSP (Q.rotate (_dbRot db)) $
|
||||
case db ^. dbType of
|
||||
Gib x col -> noPic $ drawGib' x col
|
||||
Gib x col -> noPic $ drawGib x col
|
||||
BlockDebris m -> noPic . colorSH (materialColor m) $ cubeShape 4
|
||||
|
||||
drawProp :: PropDraw -> Prop -> SPic
|
||||
drawProp = \case
|
||||
@@ -30,23 +33,12 @@ drawProp = \case
|
||||
PropVerticalLampCover h -> drawVerticalLampCover h
|
||||
PropLampCover h -> drawLampCover h
|
||||
PropDrawToggle pd' -> propDrawToggle pd'
|
||||
PropDrawGib x -> noPic . drawGib x
|
||||
-- PropDrawGib x -> noPic . drawGib x
|
||||
PropDrawFlatTranslate x -> \pr ->
|
||||
uncurryV translateSPxy (_prPos pr) $ rotateSP (_prRot pr) $ drawProp x pr
|
||||
|
||||
drawGib :: Float -> Prop -> Shape
|
||||
drawGib x pr = flesh <> skin
|
||||
where
|
||||
flesh =
|
||||
colorSH (dark $ dark red) $
|
||||
translateSHz (negate x) (baseCube & each . sfShadowImportance .~ Superfluous)
|
||||
skin =
|
||||
colorSH (_prColor pr) $
|
||||
translateSH (V3 1 1 (1 - x)) baseCube
|
||||
baseCube = upperPrismPoly Small Typical (2 * x) $ square x
|
||||
|
||||
drawGib' :: Float -> Color -> Shape
|
||||
drawGib' x col = flesh <> skin
|
||||
drawGib :: Float -> Color -> Shape
|
||||
drawGib x col = flesh <> skin
|
||||
where
|
||||
flesh =
|
||||
colorSH (dark $ dark red) $
|
||||
|
||||
Reference in New Issue
Block a user