Add random floor tiles to floors

This commit is contained in:
2021-06-16 00:14:18 +02:00
parent da631e3b37
commit 29902b6f22
10 changed files with 76 additions and 16 deletions
+17
View File
@@ -29,3 +29,20 @@ calcTexCoord cen x' y' p =
where
x = x' -.- cen
y = y' -.- cen
oTile
:: [Point2]
-> Float
-> Tile
oTile poly z = Tile
{ _tilePoly = poly
, _tileCenter = c
, _tileX = x
, _tileY = y
, _tileZ = z
}
where
c = head poly
xdir = 50 *.* (normalizeV (poly !! 1 -.- c))
x = c +.+ xdir
y = c +.+ vNormal xdir