Refactor shapes, prepare for different normals at single vertex pos

This commit is contained in:
2023-03-15 21:43:00 +00:00
parent 989140d46e
commit 249262b2b6
7 changed files with 114 additions and 136 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ import Geometry
import Data.Bifunctor
import Control.Lens
shMap :: (ShapeObj -> ShapeObj) -> Shape -> Shape
shMap :: (Surface -> Surface) -> Shape -> Shape
shMap = map
-- should all this be inlined/inlinable?
@@ -63,12 +63,12 @@ rotateSP a = bimap (rotateSH a) (rotate a)
mirrorSPxz :: SPic -> SPic
{-# INLINE mirrorSPxz #-}
mirrorSPxz = bimap (shMap (over shVs reverse) . overPosSH flipy) mirrorxz
mirrorSPxz = bimap (shMap (over sfVs reverse) . overPosSH flipy) mirrorxz
where
flipy (V3 x y z) = V3 x (negate y) z
mirrorSPyz :: SPic -> SPic
{-# INLINE mirrorSPyz #-}
mirrorSPyz = bimap (shMap (over shVs reverse) . overPosSH flipx) mirroryz
mirrorSPyz = bimap (shMap (over sfVs reverse) . overPosSH flipx) mirroryz
where
flipx (V3 x y z) = V3 (negate x) y z