Turn Shape into a stream
This commit is contained in:
@@ -43,7 +43,7 @@ translatePointToRightHand' cr
|
||||
f i = negate 2 + negate 6 * fromIntegral (sLen - i) / fromIntegral sLen
|
||||
|
||||
translateToRightHand :: Creature -> SPic -> SPic
|
||||
translateToRightHand cr = translateToRightHand' cr . mirrorSPxz
|
||||
translateToRightHand cr = translateToRightHand' cr -- . mirrorSPxz
|
||||
|
||||
translateToRightHand' :: Creature -> SPic -> SPic
|
||||
translateToRightHand' cr
|
||||
|
||||
@@ -23,7 +23,7 @@ equipPosition epos cr sh = case epos of
|
||||
OnLeftWrist -> translateToLeftHand cr sh
|
||||
OnRightWrist -> translateToRightHand cr sh
|
||||
OnLegs -> translateToLeftLeg cr sh <>
|
||||
translateToRightLeg cr (mirrorSPxz sh)
|
||||
translateToRightLeg cr sh --(mirrorSPxz sh)
|
||||
OnHead -> translateToHead cr sh
|
||||
OnChest -> translateToChest cr sh
|
||||
_ -> sh
|
||||
|
||||
@@ -99,7 +99,7 @@ teslaGun = defaultBatteryGun
|
||||
teslaGunPic :: Item -> SPic
|
||||
teslaGunPic _ = noPic $ colorSH blue $
|
||||
upperPrismPoly 5 (rectNESW xb 8 xa 0)
|
||||
++ upperPrismPoly 5 (rectNESW (-xa) 8 (-xb) 0)
|
||||
<> upperPrismPoly 5 (rectNESW (-xa) 8 (-xb) 0)
|
||||
where
|
||||
xa = 1
|
||||
xb = 9
|
||||
|
||||
@@ -31,6 +31,7 @@ import Shape
|
||||
import Sound.Data
|
||||
import LensHelp
|
||||
|
||||
import qualified Data.Vector.Fusion.Stream.Monadic as VS
|
||||
--import qualified Data.Map.Strict as M
|
||||
--import qualified Data.Sequence as Seq
|
||||
--import Control.Lens
|
||||
@@ -302,7 +303,8 @@ miniGunXPict i spin _ =
|
||||
)
|
||||
where
|
||||
aBarrel = translateSH (V3 15 2 2) baseCaneShape
|
||||
barrels = concatMap (\an -> aBarrel & rotateSHx (2*pi * fromIntegral an / fromIntegral i)) [1..i]
|
||||
barrels = VS.concatMap (\an -> aBarrel & rotateSHx (2*pi * fromIntegral an / fromIntegral i))
|
||||
$ VS.fromList [1..i]
|
||||
a = fromIntegral spin / 100
|
||||
--x = fromIntegral am / 10
|
||||
-- clip y z = translateSH (V3 0 (-1) z) (rotateSHx (negate $ pi/4)
|
||||
|
||||
@@ -41,7 +41,7 @@ shatterGun = defaultWeapon
|
||||
shatterGunSPic :: Item -> SPic
|
||||
shatterGunSPic _ = noPic $ colorSH blue $
|
||||
upperPrismPoly 5 (rectNESW xb 8 xa 0)
|
||||
++ upperPrismPoly 5 (rectNESW (-xa) 8 (-xb) 0)
|
||||
<> upperPrismPoly 5 (rectNESW (-xa) 8 (-xb) 0)
|
||||
where
|
||||
xa = 1
|
||||
xb = 9
|
||||
|
||||
@@ -56,7 +56,7 @@ flamerPic :: Item -> SPic
|
||||
flamerPic it =
|
||||
( colorSH yellow $
|
||||
translateSHf tx ty (upperPrismPoly tz $ polyCirc 3 r)
|
||||
++ upperPrismPoly 5 (rectNESW 2 18 (-2) 0)
|
||||
<> upperPrismPoly 5 (rectNESW 2 18 (-2) 0)
|
||||
, color black $ translate3 (V3 tx ty (tz+0.01)) $ circleSolid (r * am)
|
||||
)
|
||||
where
|
||||
|
||||
@@ -5,7 +5,7 @@ import Picture
|
||||
import Geometry
|
||||
import Shape
|
||||
import Quaternion
|
||||
import Bound
|
||||
--import Bound
|
||||
|
||||
--import Dodge.Data.ForegroundShape
|
||||
import Dodge.Default.Foreground
|
||||
@@ -13,8 +13,8 @@ import Data.List
|
||||
import Data.Maybe
|
||||
import Control.Lens
|
||||
import ShapePicture
|
||||
import Streaming
|
||||
import qualified Streaming.Prelude as S
|
||||
--import Streaming
|
||||
--import qualified Streaming.Prelude as S
|
||||
|
||||
highDiagonalMesh
|
||||
:: Point2
|
||||
|
||||
Reference in New Issue
Block a user