Working dynamic shadows using shape vertices buffer

This commit is contained in:
2021-09-22 10:34:39 +01:00
parent 07e128bb04
commit 952ec1c579
16 changed files with 42 additions and 67 deletions
+6 -16
View File
@@ -6,25 +6,20 @@
module Shape.Data
where
import Geometry.Data
import Control.Lens
--import qualified Data.DList as DL
type Shape = ([ShapeObj], [Point3])
type Shape = [ShapeObj]
_shVertices :: Shape -> [ShapeV]
{-# INLINE _shVertices #-}
_shVertices = concatMap _shVs . fst
_shEdges :: Shape -> [Point3]
{-# INLINE _shEdges #-}
_shEdges = snd
_shVertices = concatMap _shVs
shVList :: Shape -> [ShapeV]
{-# INLINE shVList #-}
shVList = _shVertices
--shVList = DL.toList . _shVertices
shEList :: Shape -> [Point3]
{-# INLINE shEList #-}
shEList = _shEdges
--shEList = DL.toList . _shEdges
{-# INLINE shVfromList #-}
shVfromList = id
@@ -38,9 +33,7 @@ data ShapeObj = ShapeObj
, _shVs :: [ShapeV]
}
data ShapeType
= TopPrism Int
-- | ListV
newtype ShapeType = TopPrism Int
-- edges are given by four consecutive points
data ShapeV = ShapeV
@@ -51,7 +44,4 @@ pairToSV :: (Point3,Point4) -> ShapeV
{-# INLINE pairToSV #-}
pairToSV = uncurry ShapeV
--_svPos :: ShapeV -> Point3
--_svPos = fst
--_svCol :: ShapeV -> Point4
--_svCol = snd
makeLenses ''ShapeV