Continue to tweak death effects
This commit is contained in:
@@ -2,6 +2,16 @@ module Dodge.Base.NewID where
|
|||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
|
-- | generalised way of putting a new item into a lensed intmap, returning the
|
||||||
|
-- new index as well
|
||||||
|
plNewID :: ALens' b (IM.IntMap a)
|
||||||
|
-> a
|
||||||
|
-> b
|
||||||
|
-> (Int,b)
|
||||||
|
plNewID l x w = (i,w & l #%~ IM.insert i x)
|
||||||
|
where
|
||||||
|
i = IM.newKey $ w ^# l
|
||||||
|
|
||||||
-- | place an new object into an intmap and update its id
|
-- | place an new object into an intmap and update its id
|
||||||
plNewUpID :: ALens' b (IM.IntMap a)
|
plNewUpID :: ALens' b (IM.IntMap a)
|
||||||
-> ALens' a Int
|
-> ALens' a Int
|
||||||
|
|||||||
@@ -208,6 +208,7 @@ inventoryX c = case c of
|
|||||||
testInventory :: IM.IntMap Item
|
testInventory :: IM.IntMap Item
|
||||||
testInventory = IM.fromList $ zip [0..]
|
testInventory = IM.fromList $ zip [0..]
|
||||||
[ makeTypeCraftNum 9 PIPE
|
[ makeTypeCraftNum 9 PIPE
|
||||||
|
, autoAmr
|
||||||
, brainHat
|
, brainHat
|
||||||
, headLamp
|
, headLamp
|
||||||
, autoDetector WALLDETECTOR
|
, autoDetector WALLDETECTOR
|
||||||
@@ -215,6 +216,7 @@ testInventory = IM.fromList $ zip [0..]
|
|||||||
, frontArmour
|
, frontArmour
|
||||||
, wristArmour
|
, wristArmour
|
||||||
, flatShield
|
, flatShield
|
||||||
|
, sniperRifle
|
||||||
, makeTypeCraftNum 1 MOTOR
|
, makeTypeCraftNum 1 MOTOR
|
||||||
, makeModule INCENDIARYMODULE
|
, makeModule INCENDIARYMODULE
|
||||||
, makeModule STATICMODULE
|
, makeModule STATICMODULE
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import Dodge.Data
|
|||||||
import Dodge.Clock
|
import Dodge.Clock
|
||||||
import Dodge.Creature.HandPos (translateToRightHand,translateToLeftHand)
|
import Dodge.Creature.HandPos (translateToRightHand,translateToLeftHand)
|
||||||
import Dodge.Creature.Test
|
import Dodge.Creature.Test
|
||||||
|
import Dodge.Damage
|
||||||
--import Dodge.Debug.Picture
|
--import Dodge.Debug.Picture
|
||||||
import Picture
|
import Picture
|
||||||
import Geometry
|
import Geometry
|
||||||
@@ -210,7 +211,13 @@ arms cr = fst $ translateToRightHand cr aHand
|
|||||||
-- f i = negate 2 + negate 6 * fromIntegral (sLen - i) / fromIntegral sLen
|
-- f i = negate 2 + negate 6 * fromIntegral (sLen - i) / fromIntegral sLen
|
||||||
|
|
||||||
deadScalp :: Creature -> Shape
|
deadScalp :: Creature -> Shape
|
||||||
deadScalp = overPosSH (Q.rotateToZ (V3 1 0 0)) . translateSHz 10 . scalp
|
deadScalp cr = deadRot cr . translateSHz 10 . scalp $ cr
|
||||||
|
|
||||||
|
deadRot :: Creature -> Shape -> Shape
|
||||||
|
deadRot cr = overPosSH (Q.rotateToZ d)
|
||||||
|
where
|
||||||
|
d = maybe (V3 1 0 0) (addZ 0 . unitVectorAtAngle . subtract (_crDir cr+pi))
|
||||||
|
(damageDirection . _crDamage $ _crState cr)
|
||||||
|
|
||||||
scalp :: Creature -> Shape
|
scalp :: Creature -> Shape
|
||||||
{-# INLINE scalp #-}
|
{-# INLINE scalp #-}
|
||||||
@@ -246,7 +253,7 @@ torso cr
|
|||||||
aShoulder = scaleSH (V3 10 10 1) baseShoulder
|
aShoulder = scaleSH (V3 10 10 1) baseShoulder
|
||||||
|
|
||||||
deadUpperBody :: Creature -> Shape
|
deadUpperBody :: Creature -> Shape
|
||||||
deadUpperBody = overPosSH (Q.rotateToZ (V3 1 0 0)) . translateSHz (negate 10) . upperBody
|
deadUpperBody cr = deadRot cr . translateSHz (negate 10) . upperBody $ cr
|
||||||
|
|
||||||
baseShoulder :: Shape
|
baseShoulder :: Shape
|
||||||
{-# INLINE baseShoulder #-}
|
{-# INLINE baseShoulder #-}
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ import Dodge.WorldEvent
|
|||||||
import Dodge.Creature.Action
|
import Dodge.Creature.Action
|
||||||
--import Dodge.Hammer
|
--import Dodge.Hammer
|
||||||
import Geometry
|
import Geometry
|
||||||
--import Picture
|
import Picture
|
||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
--import StrictHelp
|
--import StrictHelp
|
||||||
|
import FoldableHelp
|
||||||
|
|
||||||
|
|
||||||
--import qualified Data.IntSet as IS
|
--import qualified Data.IntSet as IS
|
||||||
--import Data.Maybe
|
--import Data.Maybe
|
||||||
@@ -54,7 +56,7 @@ foldCr xs cr w = foldr f w xs
|
|||||||
-- may affect whether the shield moves correctly
|
-- may affect whether the shield moves correctly
|
||||||
stateUpdate :: (Creature -> World -> World) -> Creature -> World -> World
|
stateUpdate :: (Creature -> World -> World) -> Creature -> World -> World
|
||||||
stateUpdate f = foldCr
|
stateUpdate f = foldCr
|
||||||
[ doDamage
|
[ clearDamage
|
||||||
, equipmentEffects
|
, equipmentEffects
|
||||||
, invSideEff
|
, invSideEff
|
||||||
, upInv -- upInv must be called before invSideEff 22.05.23
|
, upInv -- upInv must be called before invSideEff 22.05.23
|
||||||
@@ -62,6 +64,7 @@ stateUpdate f = foldCr
|
|||||||
, f
|
, f
|
||||||
, internalUpdate
|
, internalUpdate
|
||||||
, checkDeath
|
, checkDeath
|
||||||
|
, doDamage
|
||||||
]
|
]
|
||||||
|
|
||||||
checkDeath :: Creature -> World -> World
|
checkDeath :: Creature -> World -> World
|
||||||
@@ -72,13 +75,24 @@ checkDeath cr w
|
|||||||
& dropByState cr
|
& dropByState cr
|
||||||
& removecr
|
& removecr
|
||||||
& stopSoundFrom (CrWeaponSound (_crID cr) 0)
|
& stopSoundFrom (CrWeaponSound (_crID cr) 0)
|
||||||
& plNew corpses cpID thecorpse
|
& corpseOrGib cr
|
||||||
where
|
where
|
||||||
removecr
|
removecr
|
||||||
| _crID cr == 0 = (creatures . ix (_crID cr) . crUpdate .~ const id)
|
| _crID cr == 0 = (creatures . ix (_crID cr) . crUpdate .~ const id)
|
||||||
. (creatures . ix (_crID cr) . crPict .~ const mempty)
|
. (creatures . ix (_crID cr) . crPict .~ const mempty)
|
||||||
. addCrGibs cr
|
|
||||||
| otherwise = creatures . at (_crID cr) .~ Nothing
|
| otherwise = creatures . at (_crID cr) .~ Nothing
|
||||||
|
corpseOrGib :: Creature -> World -> World
|
||||||
|
corpseOrGib cr w
|
||||||
|
| _crPastDamage cr > 200 = w & addCrGibs cr
|
||||||
|
& bloodPuddleAt cpos
|
||||||
|
& bloodPuddleAt cpos
|
||||||
|
& bloodPuddleAt cpos
|
||||||
|
| otherwise = w
|
||||||
|
& bloodPuddleAt cpos
|
||||||
|
& bloodPuddleAt cpos
|
||||||
|
& plNew corpses cpID thecorpse
|
||||||
|
where
|
||||||
|
cpos = _crPos cr
|
||||||
thecorpse = Corpse
|
thecorpse = Corpse
|
||||||
{ _cpID = 0
|
{ _cpID = 0
|
||||||
, _cpPos = _crPos cr
|
, _cpPos = _crPos cr
|
||||||
@@ -87,6 +101,15 @@ checkDeath cr w
|
|||||||
, _cpRes = Nothing
|
, _cpRes = Nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bloodPuddleAt :: Point2 -> World -> World
|
||||||
|
bloodPuddleAt p w = w
|
||||||
|
& snd . plNewID decorations
|
||||||
|
(color (dark $ dark red) . setDepth 01 . uncurryV translate (p +.+ q) $ circleSolid 10)
|
||||||
|
& randGen .~ g
|
||||||
|
where
|
||||||
|
(q,g) = randInCirc 10 & runState $ _randGen w
|
||||||
|
|
||||||
internalUpdate :: Creature -> World -> World
|
internalUpdate :: Creature -> World -> World
|
||||||
internalUpdate cr = creatures . ix (_crID cr) %~
|
internalUpdate cr = creatures . ix (_crID cr) %~
|
||||||
( (crHammerPosition %~ moveHammerUp)
|
( (crHammerPosition %~ moveHammerUp)
|
||||||
@@ -102,9 +125,12 @@ dropByState cr w = foldr (dropItem cr) w $ case cr ^. crState . crDropsOnDeath o
|
|||||||
DropSpecific xs -> xs
|
DropSpecific xs -> xs
|
||||||
DropAmount n -> take n $ evalState (shuffle $ IM.keys $ _crInv cr) (_randGen w)
|
DropAmount n -> take n $ evalState (shuffle $ IM.keys $ _crInv cr) (_randGen w)
|
||||||
|
|
||||||
|
clearDamage :: Creature -> World -> World
|
||||||
|
clearDamage cr w = w
|
||||||
|
& creatures . ix (_crID cr) . crState . crDamage .~ []
|
||||||
|
|
||||||
doDamage :: Creature -> World -> World
|
doDamage :: Creature -> World -> World
|
||||||
doDamage cr w = w
|
doDamage cr w = w
|
||||||
& creatures . ix (_crID cr) . crState . crDamage .~ []
|
|
||||||
& applyPastDamages cr
|
& applyPastDamages cr
|
||||||
& _crApplyDamage cr dams cr
|
& _crApplyDamage cr dams cr
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
module Dodge.Damage where
|
module Dodge.Damage where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
import Dodge.Wall.Damage
|
import Dodge.Wall.Damage
|
||||||
|
import FoldableHelp
|
||||||
|
import Geometry.Vector
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
damageCrWall :: Damage -> Either Creature Wall -> World -> World
|
damageCrWall :: Damage -> Either Creature Wall -> World -> World
|
||||||
damageCrWall dt (Left cr) = creatures . ix (_crID cr) . crState . crDamage .:~ dt
|
damageCrWall dt (Left cr) = creatures . ix (_crID cr) . crState . crDamage .:~ dt
|
||||||
damageCrWall dt (Right wl) = damageWall dt wl
|
damageCrWall dt (Right wl) = damageWall dt wl
|
||||||
|
|
||||||
|
damageDirection :: [Damage] -> Maybe Float
|
||||||
|
damageDirection ds = do
|
||||||
|
dm <- safeMinimumOn (negate . _dmAmount) ds
|
||||||
|
safeArgV (_dmTo dm -.- _dmFrom dm)
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ module Dodge.Item.Weapon.BulletGun.Rod
|
|||||||
) where
|
) where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
import Dodge.Item.Weapon.BulletGun.Clip
|
import Dodge.Item.Weapon.BulletGun.Clip
|
||||||
|
import Dodge.Particle.HitEffect
|
||||||
|
import Dodge.Particle.Damage
|
||||||
--import Dodge.ChainEffect
|
--import Dodge.ChainEffect
|
||||||
--import Dodge.TweakBullet
|
--import Dodge.TweakBullet
|
||||||
import Dodge.Default.Weapon
|
import Dodge.Default.Weapon
|
||||||
@@ -81,6 +83,7 @@ bangRod = defaultGun
|
|||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ OneHand
|
& itUse . useAim . aimStance .~ OneHand
|
||||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
||||||
|
& itConsumption . aoType . amBulEff .~ expireAndDamage heavyBulDams
|
||||||
baseRodShape :: Shape
|
baseRodShape :: Shape
|
||||||
baseRodShape = colorSH orange $ upperPrismPoly 3 $ rectXH 20 2
|
baseRodShape = colorSH orange $ upperPrismPoly 3 $ rectXH 20 2
|
||||||
baseAMRShape :: Shape
|
baseAMRShape :: Shape
|
||||||
|
|||||||
@@ -27,6 +27,16 @@ simpleDam dt amount bt p = [ Damage dt amount sp p ep NoDamageEffect ]
|
|||||||
bulVel = _ptVel bt
|
bulVel = _ptVel bt
|
||||||
ep = sp +.+ bulVel
|
ep = sp +.+ bulVel
|
||||||
|
|
||||||
|
heavyBulDams :: Particle -> Point2 -> [Damage]
|
||||||
|
heavyBulDams bt p =
|
||||||
|
[ Damage PIERCING 300 sp p ep NoDamageEffect
|
||||||
|
, Damage PUSHDAM 1 sp p ep . PushBackDamage $ 2 *.* bulVel
|
||||||
|
]
|
||||||
|
where
|
||||||
|
sp = head $ _ptTrail bt
|
||||||
|
bulVel = _ptVel bt
|
||||||
|
ep = sp +.+ bulVel
|
||||||
|
|
||||||
basicBulDams :: Particle -> Point2 -> [Damage]
|
basicBulDams :: Particle -> Point2 -> [Damage]
|
||||||
basicBulDams bt p =
|
basicBulDams bt p =
|
||||||
[ Damage PIERCING 100 sp p ep NoDamageEffect
|
[ Damage PIERCING 100 sp p ep NoDamageEffect
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
module Dodge.Particle.HitEffect
|
module Dodge.Particle.HitEffect
|
||||||
( penWalls
|
( penWalls
|
||||||
|
, module Dodge.Particle.HitEffect.ExpireAndDamage
|
||||||
) where
|
) where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
import Dodge.Particle.Update
|
import Dodge.Particle.Update
|
||||||
|
import Dodge.Particle.HitEffect.ExpireAndDamage
|
||||||
import Geometry
|
import Geometry
|
||||||
|
|
||||||
import Data.Bifunctor
|
import Data.Bifunctor
|
||||||
|
|||||||
@@ -143,16 +143,6 @@ addPane wl l wls = IM.insert wlid (wl { _wlLine = l, _wlID = wlid }) wls
|
|||||||
where
|
where
|
||||||
wlid = IM.newKey wls
|
wlid = IM.newKey wls
|
||||||
|
|
||||||
-- | generalised way of putting a new item into a lensed intmap, returning the
|
|
||||||
-- new index as well
|
|
||||||
plNewID :: ALens' World (IM.IntMap a)
|
|
||||||
-> a
|
|
||||||
-> World
|
|
||||||
-> (Int,World)
|
|
||||||
plNewID l x w = (i,w & l #%~ IM.insert i x)
|
|
||||||
where
|
|
||||||
i = IM.newKey $ w ^# l
|
|
||||||
|
|
||||||
---- | place an new object into an intmap and update its id
|
---- | place an new object into an intmap and update its id
|
||||||
--plNewUpID :: ALens' World (IM.IntMap a)
|
--plNewUpID :: ALens' World (IM.IntMap a)
|
||||||
-- -> ALens' a Int
|
-- -> ALens' a Int
|
||||||
|
|||||||
+28
-2
@@ -2,6 +2,7 @@ module Dodge.Prop.Gib where
|
|||||||
import Dodge.Zone
|
import Dodge.Zone
|
||||||
import Dodge.Base
|
import Dodge.Base
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
|
import Dodge.Damage
|
||||||
import ShapePicture
|
import ShapePicture
|
||||||
import Shape
|
import Shape
|
||||||
import Geometry
|
import Geometry
|
||||||
@@ -20,7 +21,7 @@ aGib = PropZ
|
|||||||
{_pjPos = 0
|
{_pjPos = 0
|
||||||
,_pjStartPos = 0
|
,_pjStartPos = 0
|
||||||
,_pjVel = 0
|
,_pjVel = 0
|
||||||
,_prDraw = drawGib 4
|
,_prDraw = drawGib 3
|
||||||
,_pjID = 0
|
,_pjID = 0
|
||||||
,_pjUpdate = updateGib
|
,_pjUpdate = updateGib
|
||||||
,_pjPosZ = 10
|
,_pjPosZ = 10
|
||||||
@@ -73,10 +74,14 @@ updateGib' w pr
|
|||||||
Just (p,v') -> (pjPos .~ p) . (pjVel .~ v')
|
Just (p,v') -> (pjPos .~ p) . (pjVel .~ v')
|
||||||
|
|
||||||
addCrGibs :: Creature -> World -> World
|
addCrGibs :: Creature -> World -> World
|
||||||
addCrGibs cr w = w
|
addCrGibs cr w = case damageDirection $ _crDamage $ _crState cr of
|
||||||
|
Nothing -> w
|
||||||
& addGibAt 25 (_skinHead skin) cpos
|
& addGibAt 25 (_skinHead skin) cpos
|
||||||
& addGibsAt 3 7 (_skinLower skin) cpos
|
& addGibsAt 3 7 (_skinLower skin) cpos
|
||||||
& addGibsAt 13 20 (_skinUpper skin) cpos
|
& addGibsAt 13 20 (_skinUpper skin) cpos
|
||||||
|
Just d -> w
|
||||||
|
& addGibsAtDir d 3 7 (_skinLower skin) cpos
|
||||||
|
& addGibsAtDir d 13 20 (_skinUpper skin) cpos
|
||||||
where
|
where
|
||||||
skin = _crSkin cr
|
skin = _crSkin cr
|
||||||
cpos = _crPos cr
|
cpos = _crPos cr
|
||||||
@@ -101,6 +106,27 @@ addGibsAt minh maxh col p w = foldr addg w (zip4 vels zspeeds quats hs)
|
|||||||
& pjPosZ .~ h
|
& pjPosZ .~ h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
-- this is ugly because it is mostly copy-paste from addGibsAt
|
||||||
|
addGibsAtDir :: Float -> Float -> Float -> Color -> Point2 -> World -> World
|
||||||
|
addGibsAtDir dir minh maxh col p w = foldr addg w (zip4 vels zspeeds quats hs)
|
||||||
|
& randGen .~ newg
|
||||||
|
where
|
||||||
|
(speeds,newg) = replicateM 4 (state (randomR (1,4))) & runState $ _randGen w
|
||||||
|
hs = replicateM 4 (state (randomR (minh,maxh))) & evalState $ _randGen w
|
||||||
|
dirs = unitVectorAtAngle <$> (randsSpread (dir-pi/4,dir+pi/4) 4 & evalState $ _randGen w)
|
||||||
|
vels = zipWith (*.*) speeds dirs
|
||||||
|
zspeeds = replicateM 4 (state (randomR (-8,8))) & evalState $ _randGen w
|
||||||
|
quats :: [Q.Quaternion Float]
|
||||||
|
quats = replicateM 4 (Q.vToQuat (V3 0 0 1) <$> randOnUnitSphere) & evalState $ _randGen w
|
||||||
|
addg (v,zs,q,h) = plNew props pjID (aGib & pjPos .~ p +.+ (5 *.* normalizeV v)
|
||||||
|
& pjColor .~ col
|
||||||
|
& pjVel .~ v
|
||||||
|
& pjQuatSpin .~ Q.axisAngle (vNormal v `v2z` 0) (-0.1)
|
||||||
|
& pjQuat .~ q
|
||||||
|
& pjVelZ .~ zs
|
||||||
|
& pjPosZ .~ h
|
||||||
|
)
|
||||||
|
|
||||||
addGibAt :: Float -> Color -> Point2 -> World -> World
|
addGibAt :: Float -> Color -> Point2 -> World -> World
|
||||||
addGibAt h col p w = w
|
addGibAt h col p w = w
|
||||||
& plNew props pjID gib
|
& plNew props pjID gib
|
||||||
|
|||||||
+13
-5
@@ -97,9 +97,17 @@ maybeTakeOne :: RandomGen g => [a] -> State g (Maybe a)
|
|||||||
maybeTakeOne [] = return Nothing
|
maybeTakeOne [] = return Nothing
|
||||||
maybeTakeOne xs = state (randomR (0,length xs - 1)) >>= (\i -> return (Just (xs !! i)))
|
maybeTakeOne xs = state (randomR (0,length xs - 1)) >>= (\i -> return (Just (xs !! i)))
|
||||||
|
|
||||||
randsOnCirc :: RandomGen g => Int -> State g [Float]
|
randsSpread :: RandomGen g => (Float,Float) -> Int -> State g [Float]
|
||||||
randsOnCirc i
|
randsSpread (a,b) i
|
||||||
| i <= 0 = error "tried to take <= 0 randsOnCirc"
|
| i <= 0 = error "tried to take <= 0 randsSpread"
|
||||||
| otherwise = zipWith (+) [x,2*x..] <$> replicateM i (state $ randomR (0,x))
|
| otherwise = zipWith (+) [a+x,a+2*x..] <$> replicateM i (state $ randomR (0,x))
|
||||||
where
|
where
|
||||||
x = 2*pi/fromIntegral i
|
x = (b-a)/fromIntegral i
|
||||||
|
|
||||||
|
randsOnCirc :: RandomGen g => Int -> State g [Float]
|
||||||
|
randsOnCirc = randsSpread (0,2*pi)
|
||||||
|
--randsOnCirc i
|
||||||
|
-- | i <= 0 = error "tried to take <= 0 randsOnCirc"
|
||||||
|
-- | otherwise = zipWith (+) [x,2*x..] <$> replicateM i (state $ randomR (0,x))
|
||||||
|
-- where
|
||||||
|
-- x = 2*pi/fromIntegral i
|
||||||
|
|||||||
@@ -68,6 +68,13 @@ dotV (V2 x y) (V2 z w) = x*z + y*w
|
|||||||
argV :: Point2 -> Float
|
argV :: Point2 -> Float
|
||||||
{-# INLINE argV #-}
|
{-# INLINE argV #-}
|
||||||
argV (V2 x y) = normalizeAngle $ atan2 y x
|
argV (V2 x y) = normalizeAngle $ atan2 y x
|
||||||
|
|
||||||
|
{- | Given vector, returns the angle, anticlockwise from +ve x-axis, in radians.
|
||||||
|
Returns Nothing for a 0 0 vector. -}
|
||||||
|
safeArgV :: Point2 -> Maybe Float
|
||||||
|
{-# INLINE safeArgV #-}
|
||||||
|
safeArgV (V2 0 0) = Nothing
|
||||||
|
safeArgV v = Just $ argV v
|
||||||
{- | Determinant of the matrix formed by two vectors. -}
|
{- | Determinant of the matrix formed by two vectors. -}
|
||||||
detV :: Point2 -> Point2 -> Float
|
detV :: Point2 -> Point2 -> Float
|
||||||
{-# INLINE detV #-}
|
{-# INLINE detV #-}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import qualified Linear.Quaternion as Q
|
|||||||
import Linear.Quaternion
|
import Linear.Quaternion
|
||||||
|
|
||||||
-- apply a rotation as if the z axis moves to the new point.
|
-- apply a rotation as if the z axis moves to the new point.
|
||||||
|
-- i think this may instead do as if the new point moves to be on z axis
|
||||||
rotateToZ :: Point3 -> Point3 -> Point3
|
rotateToZ :: Point3 -> Point3 -> Point3
|
||||||
rotateToZ z1
|
rotateToZ z1
|
||||||
| cprod == V3 0 0 0 = id
|
| cprod == V3 0 0 0 = id
|
||||||
|
|||||||
Reference in New Issue
Block a user