Work on bouncing debris

This commit is contained in:
2025-08-02 22:14:25 +01:00
parent eeb7c8ac88
commit 5722ca8204
13 changed files with 141 additions and 1090 deletions
+7 -15
View File
@@ -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) $