Fix winding of corner points for line blocks
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -69,7 +69,7 @@ plLineBlock basePane blwidth a b gw =
|
|||||||
blockCenPs = snd $ evenOddSplit psOnLine
|
blockCenPs = snd $ evenOddSplit psOnLine
|
||||||
numBlocks = length blockCenPs
|
numBlocks = length blockCenPs
|
||||||
is = [0 .. numBlocks - 1]
|
is = [0 .. numBlocks - 1]
|
||||||
cornerPoints = rectWH halfBlockWidth depth -- goes clockwise around the block
|
cornerPoints = reverse $ rectWH halfBlockWidth depth -- goes clockwise around the block
|
||||||
cornersAt p = fmap ((p +.+) . rotateV (argV (b -.- a))) cornerPoints
|
cornersAt p = fmap ((p +.+) . rotateV (argV (b -.- a))) cornerPoints
|
||||||
linesAt p = loopPairs $ cornersAt p
|
linesAt p = loopPairs $ cornersAt p
|
||||||
wlid = IM.newKey $ gw ^. cWorld . lWorld . walls
|
wlid = IM.newKey $ gw ^. cWorld . lWorld . walls
|
||||||
|
|||||||
@@ -22,11 +22,12 @@ import LensHelp
|
|||||||
import RandomHelp
|
import RandomHelp
|
||||||
|
|
||||||
cenLasTur :: Room
|
cenLasTur :: Room
|
||||||
cenLasTur =
|
cenLasTur = roomNgon 8 200 & rmPmnts .~
|
||||||
roomNgon 8 200 & rmPmnts
|
[ putLasTurret 0.02
|
||||||
.~ [ putLasTurret 0.02
|
, heightWallPS
|
||||||
-- .~ [ putTurret autoRifle 0.02
|
(resetPLUse $ rprBoolShift (const . isInLnk) (shiftInBy 100))
|
||||||
, heightWallPS (resetPLUse $ rprBoolShift (const . isInLnk) (shiftInBy 100)) 30 covershape
|
30
|
||||||
|
covershape
|
||||||
, mntLightLnkCond $ rprBool $ const . isInLnk
|
, mntLightLnkCond $ rprBool $ const . isInLnk
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -204,12 +204,6 @@ isLeftOf x y = isLeftOfA (argV x) (argV y)
|
|||||||
diffAngles :: Float -> Float -> Float
|
diffAngles :: Float -> Float -> Float
|
||||||
diffAngles x y = nearZeroAngle $ x - y
|
diffAngles x y = nearZeroAngle $ x - y
|
||||||
|
|
||||||
mixAngles :: Float -> Float -> Float -> Float
|
|
||||||
mixAngles frac a1 a2
|
|
||||||
| abs (a1 - a2) <= pi = normalizeAngle $ frac * a1 + (1 - frac) * a2
|
|
||||||
| a1 > a2 = mixAngles frac (a1 - 2 * pi) a2
|
|
||||||
| otherwise = mixAngles frac (a1 + 2 * pi) a2
|
|
||||||
|
|
||||||
-- | Return Just a point if it is inside a circle, Nothing otherwise.
|
-- | Return Just a point if it is inside a circle, Nothing otherwise.
|
||||||
pointInCircle :: Point2 -> Float -> Point2 -> Maybe Point2
|
pointInCircle :: Point2 -> Float -> Point2 -> Maybe Point2
|
||||||
pointInCircle p r c
|
pointInCircle p r c
|
||||||
|
|||||||
Reference in New Issue
Block a user