Commit before improving item targeting

This commit is contained in:
2022-02-22 10:47:15 +00:00
parent ff84363a13
commit 69490bb984
12 changed files with 83 additions and 50 deletions
+9 -9
View File
@@ -56,19 +56,19 @@ polygon :: [Point2] -> Picture
{-# INLINE polygon #-}
polygon = map f . polyToTris
where
f (V2 x y) = Verx (V3 x y 0) black [] 0 polyNum
f (V2 x y) = Verx (V3 x y 0) black [] (LayNum 0) polyNum
polygonZ :: [Point2] -> Float -> Picture
{-# INLINE polygonZ #-}
polygonZ ps z = map (f . zeroZ) $ polyToTris ps
where
f pos = Verx pos black [z] 0 polyzNum
f pos = Verx pos black [z] (LayNum 0) polyzNum
polygonCol :: [(Point2,RGBA)] -> Picture
{-# INLINE polygonCol #-}
polygonCol = polyToTris . map f
where
f (V2 x y,col) = Verx (V3 x y 0) col [] 0 polyNum
f (V2 x y,col) = Verx (V3 x y 0) col [] (LayNum 0) polyNum
poly3 :: [Point3] -> Picture
{-# INLINE poly3 #-}
@@ -78,7 +78,7 @@ poly3Col :: [(Point3,RGBA)] -> Picture
{-# INLINE poly3Col #-}
poly3Col = map f . polyToTris
where
f (pos,col) = Verx pos col [] 0 polyNum
f (pos,col) = Verx pos col [] (LayNum 0) polyNum
-- note that much of work computing the width of the bezier curve is done here
bezierQuad :: Color -> Color -> Float -> Float -> Point2 -> Point2 -> Point2 -> Picture
@@ -117,7 +117,7 @@ bezierQuad cola colc ra rc a b c
bzhelp :: [(Point2, Point4, Point2, Point2)] -> Picture
bzhelp = map f
where
f (V2 x y,col,V2 a b,V2 c d) = Verx (V3 x y 0) col [a,b,c,d] 0 bezNum
f (V2 x y,col,V2 a b,V2 c d) = Verx (V3 x y 0) col [a,b,c,d] (LayNum 0) bezNum
-- given a one and two zeros of a linear function over x and y,
-- determine the function
@@ -169,7 +169,7 @@ setLayer :: Int -> Picture -> Picture
{-# INLINE setLayer #-}
setLayer i = map f
where
f v = v {_vxLayer = i}
f v = v {_vxLayer = LayNum i}
scale3 :: Float -> Float -> Point3 -> Point3
{-# INLINE scale3 #-}
@@ -214,7 +214,7 @@ circleSolidCol colC colE r = map f
,(V3 r (-r) 0, black)
]
where
f (pos,col) = Verx pos col [] 0 ellNum
f (pos,col) = Verx pos col [] (LayNum 0) ellNum
circle :: Float -> Picture
{-# INLINE circle #-}
@@ -228,7 +228,7 @@ text :: String -> Picture
{-# INLINE text #-}
text = map f . stringToList
where
f (pos,col,V2 a b) = Verx pos col [a,b] 0 textNum
f (pos,col,V2 a b) = Verx pos col [a,b] (LayNum 0) textNum
line :: [Point2] -> Picture
{-# INLINE line #-}
@@ -321,7 +321,7 @@ thickArcHelp startA endA rad wdth = map f
(V2 xb yb) = rotateV (0.5 * (startA + endA)) (V2 (rad * sqrt 2) 0)
--(V2 xb yb) = rotateV (0.5 * (startA + endA)) (V2 (rad * 2) 0)
(V2 xc yc) = rotateV endA (V2 rad 0)
f (pos,col,V3 a b c) = Verx pos col [a,b,c] 0 arcNum
f (pos,col,V3 a b c) = Verx pos col [a,b,c] (LayNum 0) arcNum
-- Currently the lens version is much slower