Implement headlamp

This commit is contained in:
2022-05-23 11:24:44 +01:00
parent 46123de69c
commit 4cc8394f2c
4 changed files with 34 additions and 1 deletions
+11 -1
View File
@@ -3,7 +3,7 @@ import Dodge.Data
import Dodge.Creature.Test
--import Shape
import ShapePicture
--import Geometry
import Geometry
import Control.Lens
import Data.Maybe
@@ -72,9 +72,19 @@ translateToRightLeg cr = rotateSP (_crMvDir cr - _crDir cr) . case cr ^? crStanc
translateToHead :: Creature -> SPic -> SPic
translateToHead cr
| twists cr = translateSPz 20 . translateSPf 0 5 . rotateSP (-1) . translateSPf (negate 2.5) 0.25
. rotateSP 1
| oneH cr = translateSPz 20 . rotateSP 0.5 . translateSPf 2.5 0
. rotateSP (negate 0.5)
| otherwise = translateSPz 20 . translateSPf 2.5 0
translatePointToHead :: Creature -> Point3 -> Point3
translatePointToHead cr
| twists cr = (+.+.+ V3 0 5 20) . rotate3 (-1) . (+.+.+ V3 (negate 2.5) 0.25 0)
. rotate3 1
| oneH cr = (+.+.+ V3 0 0 20) . rotate3 0.5 . (+.+.+ V3 2.5 0 0)
. rotate3 (negate 0.5)
| otherwise = (+.+.+ V3 2.5 0 20)
translateToChest :: Creature -> SPic -> SPic
translateToChest cr
| oneH cr = rotateSP 0.5