Improve chasm falls, add ear clipping
This commit is contained in:
@@ -150,7 +150,8 @@ chasmTestLiving cr w
|
||||
where
|
||||
tocr = cWorld . lWorld . creatures . ix (_crID cr)
|
||||
g = uncurry $ circOnSeg (cr ^. crPos . _xy) (crRad $ cr ^. crType)
|
||||
f = circInPolygon (cr ^. crPos . _xy) (crRad $ cr ^. crType)
|
||||
--f = circInPolygon (cr ^. crPos . _xy) (crRad $ cr ^. crType)
|
||||
f = pointInPoly (cr ^. crPos . _xy)
|
||||
|
||||
chasmTestCorpse :: Creature -> World -> World
|
||||
chasmTestCorpse cr w
|
||||
@@ -168,7 +169,8 @@ chasmTestCorpse cr w
|
||||
where
|
||||
tocr = cWorld . lWorld . creatures . ix (_crID cr)
|
||||
g = uncurry $ circOnSeg (cr ^. crPos . _xy) (crRad $ cr ^. crType)
|
||||
f = circInPolygon (cr ^. crPos . _xy) (crRad $ cr ^. crType)
|
||||
--f = circInPolygon (cr ^. crPos . _xy) (crRad $ cr ^. crType)
|
||||
f = pointInPoly (cr ^. crPos . _xy)
|
||||
|
||||
chasmRotate :: Creature -> Point2 -> World -> World
|
||||
chasmRotate cr v w
|
||||
|
||||
@@ -238,8 +238,8 @@ sqPlatformChasm b a =
|
||||
|
||||
sqSpitChasm :: Float -> Float -> ([[Point2]], [[Point2]])
|
||||
sqSpitChasm b a =
|
||||
( --[[ibr, obr, otr, itr], [itr, otr, otl, itl], [itl, otl, obl, ibl]]
|
||||
convexPartition clfs
|
||||
( [[ibr, obr, otr, itr], [itr, otr, otl, itl], [itl, otl, obl, ibl]]
|
||||
-- ( earClip clfs
|
||||
, [clfs]
|
||||
)
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user