Refactor shapes, prepare for different normals at single vertex pos
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user