Add aggressive light culling
This commit is contained in:
@@ -4,6 +4,7 @@ and the position that the character sees from: '_cameraViewFrom'. -}
|
||||
module Dodge.Update.Camera
|
||||
( updateCamera
|
||||
, farWallPoints
|
||||
, farWallDistDirection
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Base
|
||||
@@ -202,7 +203,17 @@ farWallDist p cfig w = (winFac /)
|
||||
grs = filter (pointInOrOnPolygon p . _grBound) (_gameRooms w)
|
||||
wos = wallsOnScreen cfig w
|
||||
distFromEqmnt = foldr max 1 $ IM.mapMaybe (_eqViewDist . _eqEq. _itUse) $ getCrEquipment $ you w
|
||||
|
||||
|
||||
farWallDistDirection :: Point2 -> Configuration -> World -> (Float,Float,Float,Float)
|
||||
--farWallDist p cfig w = (winFac /) . min maxViewDistance $ ssfold (> maxViewDistance) findMax 1 vps
|
||||
farWallDistDirection p cfig w = foldr m (0,0,0,0) $ map f vps
|
||||
where
|
||||
f q = g $ rotateV (negate $ _cameraRot w) $ collidePointWallsFilter wlIsOpaque p q wos -.- p
|
||||
g (V2 x y) = (y, negate y, x, negate x)
|
||||
m (a,b,c,d) (x,y,z,w') = (max a x, max b y, max c z, max d w')
|
||||
vps = concatMap _grViewpoints grs ++ extendedViewPoints p grs
|
||||
grs = filter (pointInOrOnPolygon p . _grBound) (_gameRooms w)
|
||||
wos = wallsOnScreen cfig w
|
||||
|
||||
extendedViewPoints :: Point2 -> [GameRoom] -> [Point2]
|
||||
extendedViewPoints p grs = map extend
|
||||
|
||||
Reference in New Issue
Block a user