Fix aiming with scope

This commit is contained in:
2023-12-26 21:45:59 +00:00
parent 3b4bef944d
commit 26c55ee7f5
14 changed files with 85 additions and 114 deletions
+7 -7
View File
@@ -133,13 +133,13 @@ wasdWithAiming w speed cr
dir = fmap ((w ^. wCam . camRot) +) (safeArgV movDir)
movAbs = rotateV (w ^. wCam . camRot) $ normalizeV movDir
isAiming = _posture (_crStance cr) == Aiming
mouseDir = fromMaybe
(argV (_mousePos (_input w)) + (w ^. wCam . camRot))
$ do
itRef <- cr ^? crManipulation . manObject . inInventory . ispItem
-- _ <- cr ^? crInv . ix itRef . itScope . scopePos
_ <- cr ^? crInv . ix itRef . itScope . remotePos
return . argV $ mouseWorldPos (w ^. input) (w ^. wCam) -.- _crPos cr
mouseDir = argV $ mouseWorldPos (w ^. input) (w ^. wCam) - (cr ^. crPos)
-- mouseDir = fromMaybe
-- (argV (_mousePos (_input w)) + (w ^. wCam . camRot))
-- $ do
-- itRef <- cr ^? crManipulation . manObject . inInventory . ispItem
-- _ <- cr ^? crInv . ix itRef . itScope . remotePos
-- return . argV $ mouseWorldPos (w ^. input) (w ^. wCam) -.- _crPos cr
aimTurn :: Float -> Creature -> Creature
aimTurn a cr = creatureTurnTowardDir a (x * 0.2) cr