Draw shape shadows using index buffer

This commit is contained in:
2021-09-21 00:43:45 +01:00
parent 5cbcbec101
commit 7f1a365cac
9 changed files with 167 additions and 41 deletions
+13 -2
View File
@@ -8,10 +8,11 @@ module Shape.Data
import Geometry.Data
--import qualified Data.DList as DL
type Shape = ([ShapeV], [Point3])
type Shape = ([ShapeObj], [Point3])
_shVertices :: Shape -> [ShapeV]
{-# INLINE _shVertices #-}
_shVertices = fst
_shVertices = concatMap _shVs . fst
_shEdges :: Shape -> [Point3]
{-# INLINE _shEdges #-}
_shEdges = snd
@@ -32,6 +33,16 @@ shVfromList = id
shEfromList = id
--shEfromList = DL.fromList
data ShapeObj = ShapeObj
{ _shType :: ShapeType
, _shVs :: [ShapeV]
}
data ShapeType
= ListV
| TopHexahedron -- ^ assumed convex, eight vertices
| TopPrism Int
-- edges are given by four consecutive points
data ShapeV = ShapeV
{_svPos :: Point3