Refactor crPos to be a V3
This commit is contained in:
@@ -6,6 +6,7 @@ module Dodge.Item.BackgroundEffect (
|
||||
removeShieldWall,
|
||||
) where
|
||||
|
||||
import Linear
|
||||
import Color
|
||||
import Control.Lens
|
||||
import Dodge.Creature.Radius
|
||||
@@ -46,7 +47,7 @@ createShieldWall it cr w = case it ^? itParams . flatShieldWlMIX . _Just of
|
||||
crid = _crID cr
|
||||
wlline = (a, b)
|
||||
crdirv = unitVectorAtAngle $ _crDir cr
|
||||
crpos = _crPos cr
|
||||
crpos =cr ^. crPos . _xy
|
||||
rad = crRad (cr ^. crType) + 2
|
||||
a = crpos +.+ rad *.* crdirv -.- 10 *.* therot crdirv
|
||||
b = crpos +.+ rad *.* crdirv +.+ 10 *.* therot crdirv
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
module Dodge.Item.Weapon.Shatter (shootShatter) where
|
||||
|
||||
import Linear
|
||||
import Dodge.Base.Collide
|
||||
import Dodge.Block.Debris
|
||||
import Dodge.Data.World
|
||||
@@ -18,7 +19,7 @@ shootShatter _ cr w =
|
||||
Opaque {} -> True
|
||||
SeeThrough -> True
|
||||
_ -> False
|
||||
sp = _crPos cr +.+ 10 *.* unitVectorAtAngle dir
|
||||
sp = cr ^. crPos ._xy +.+ 10 *.* unitVectorAtAngle dir
|
||||
-- the 10 is arbtrary and should be changed to a muzzle position
|
||||
dir = _crDir cr
|
||||
ep = sp +.+ 200 *.* unitVectorAtAngle dir
|
||||
|
||||
Reference in New Issue
Block a user