Files
loop/src/Data/Tile.hs
T
2026-04-01 18:01:11 +01:00

32 lines
756 B
Haskell

{-# LANGUAGE TemplateHaskell #-}
--{-# LANGUAGE StrictData #-}
module Data.Tile where
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Geometry.Data
data Floor
= InheritFloor
| -- | TileWith Float
Tiled {_tiles :: [Tile]}
data Tile = Tile
{ _tilePoly :: [Point2]
, -- | point in the world where tile texture is 0,0
_tileZero :: Point2
, -- | world position one along in the X direction
-- note this also sets the scale of the texture
-- this has to be a position because it is shifted
_tileTangentPos :: Point2
, _tileArrayZ :: Float
, _tileZeroShift :: Maybe Point2A
}
deriving (Eq, Ord, Show)
makeLenses ''Floor
makeLenses ''Tile
deriveJSON defaultOptions ''Tile