16 lines
475 B
Haskell
16 lines
475 B
Haskell
{-# OPTIONS -Wno-incomplete-uni-patterns #-}
|
|
module Dodge.WdP2f (doWdP2f) where
|
|
|
|
import Dodge.ShiftPoint
|
|
import Control.Lens
|
|
import Dodge.Data.World
|
|
import Geometry.Data
|
|
|
|
-- # OPTIONS -Wno-incomplete-uni-patterns #-}
|
|
doWdP2f :: WdP2f -> World -> (Point2, Float)
|
|
doWdP2f x = case x of
|
|
WdP2f0 -> const (0, 0)
|
|
WdP2fDoorPosition drid -> \w ->
|
|
let dr = w ^?! cWorld . lWorld . doors . ix drid
|
|
in lerpP2A (dr ^. drZeroPos) (dr ^. drOnePos) (dr ^. drLerp)
|