Draw shape shadows using index buffer
This commit is contained in:
+13
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user