Cleanup
This commit is contained in:
@@ -1,17 +1,33 @@
|
|||||||
module Dodge.Creature.HandPos where
|
module Dodge.Creature.HandPos (
|
||||||
|
aimingWeaponZeroPos,
|
||||||
|
aimingMuzzlePos,
|
||||||
|
aimingMuzzleLength,
|
||||||
|
translatePointToLeftHand,
|
||||||
|
translatePointToRightHand,
|
||||||
|
translatePointToHead,
|
||||||
|
translateToLeftWrist,
|
||||||
|
translateToRightWrist,
|
||||||
|
translateToLeftLeg,
|
||||||
|
translateToRightLeg,
|
||||||
|
translateToHead,
|
||||||
|
translateToChest,
|
||||||
|
translateToBack,
|
||||||
|
translateToLeftHand,
|
||||||
|
translateToRightHand,
|
||||||
|
) where
|
||||||
|
|
||||||
import Linear
|
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Dodge.Creature.Test
|
import Dodge.Creature.Test
|
||||||
import Dodge.Data.Creature
|
import Dodge.Data.Creature
|
||||||
import Geometry
|
import Geometry
|
||||||
|
import Linear
|
||||||
import ShapePicture
|
import ShapePicture
|
||||||
|
|
||||||
-- the position of a weapon handle
|
-- the position of a weapon handle
|
||||||
aimingWeaponHandlePos :: Creature -> Item -> Point2
|
aimingWeaponHandlePos :: Creature -> Item -> Point2
|
||||||
aimingWeaponHandlePos _ it = case it ^? itUse . heldAim . aimStance of
|
aimingWeaponHandlePos _ it = case it ^? itUse . heldAim . aimStance of
|
||||||
Just TwoHandUnder -> 0
|
Just TwoHandUnder -> 0
|
||||||
Just TwoHandOver -> V2 (-7) 0
|
Just TwoHandOver -> V2 (-7) 0
|
||||||
Just OneHand -> V2 10 (-2)
|
Just OneHand -> V2 10 (-2)
|
||||||
Just TwoHandFlat -> V2 10 0
|
Just TwoHandFlat -> V2 10 0
|
||||||
@@ -27,11 +43,6 @@ aimingMuzzlePos cr it = fmap ((+ zp) . _mzPos) (it ^.. itUse . heldAim . aimMuzz
|
|||||||
where
|
where
|
||||||
zp = aimingWeaponZeroPos cr it
|
zp = aimingWeaponZeroPos cr it
|
||||||
|
|
||||||
aimingMuzzleOff :: Creature -> Item -> [Point2]
|
|
||||||
aimingMuzzleOff cr it = fmap (rotateV (_crDir cr) . (+ zp) . _mzPos) (it ^.. itUse . heldAim . aimMuzzles . folded)
|
|
||||||
where
|
|
||||||
zp = aimingWeaponZeroPos cr it
|
|
||||||
|
|
||||||
aimingMuzzleLength :: Creature -> Item -> Float
|
aimingMuzzleLength :: Creature -> Item -> Float
|
||||||
aimingMuzzleLength cr it = head (aimingMuzzlePos cr it) ^. _x
|
aimingMuzzleLength cr it = head (aimingMuzzlePos cr it) ^. _x
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
module Dodge.Item.HeldOffset where
|
module Dodge.Item.HeldOffset (
|
||||||
|
turretItemOffset,
|
||||||
|
twoFlatHRot,
|
||||||
|
heldItemOffset,
|
||||||
|
) where
|
||||||
|
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Dodge.Creature.HandPos
|
import Dodge.Creature.HandPos
|
||||||
@@ -66,4 +70,4 @@ strideRot cr = case cr ^? crStance . carriage of
|
|||||||
sLen = _strideLength $ _crStance cr
|
sLen = _strideLength $ _crStance cr
|
||||||
|
|
||||||
twoFlatHRot :: Creature -> Float
|
twoFlatHRot :: Creature -> Float
|
||||||
twoFlatHRot cr = 2 * strideRot cr
|
twoFlatHRot = (2 *) . strideRot
|
||||||
|
|||||||
Reference in New Issue
Block a user