module Geometry.Plane
( Plane(..)
, xyBack
, xyFront
, xzUp
, xzDown
, yzLeft
, yzRight
) where
import RIO
import Geomancy (Vec3, vec3)
data Plane = Plane
{ Plane -> Vec3
normal :: Vec3
, Plane -> Float
depth :: Float
}
deriving (Int -> Plane -> ShowS
[Plane] -> ShowS
Plane -> String
(Int -> Plane -> ShowS)
-> (Plane -> String) -> ([Plane] -> ShowS) -> Show Plane
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Plane] -> ShowS
$cshowList :: [Plane] -> ShowS
show :: Plane -> String
$cshow :: Plane -> String
showsPrec :: Int -> Plane -> ShowS
$cshowsPrec :: Int -> Plane -> ShowS
Show)
xyBack :: Float -> Plane
xyBack :: Float -> Plane
xyBack Float
d = Plane :: Vec3 -> Float -> Plane
Plane
{ $sel:normal:Plane :: Vec3
normal = Float -> Float -> Float -> Vec3
vec3 Float
0 Float
0 (-Float
1)
, $sel:depth:Plane :: Float
depth = Float
d
}
xyFront :: Float -> Plane
xyFront :: Float -> Plane
xyFront Float
d = Plane :: Vec3 -> Float -> Plane
Plane
{ $sel:normal:Plane :: Vec3
normal = Float -> Float -> Float -> Vec3
vec3 Float
0 Float
0 Float
1
, $sel:depth:Plane :: Float
depth = Float
d
}
xzUp :: Float -> Plane
xzUp :: Float -> Plane
xzUp Float
d = Plane :: Vec3 -> Float -> Plane
Plane
{ $sel:normal:Plane :: Vec3
normal = Float -> Float -> Float -> Vec3
vec3 Float
0 (-Float
1) Float
0
, $sel:depth:Plane :: Float
depth = Float
d
}
xzDown :: Float -> Plane
xzDown :: Float -> Plane
xzDown Float
d = Plane :: Vec3 -> Float -> Plane
Plane
{ $sel:normal:Plane :: Vec3
normal = Float -> Float -> Float -> Vec3
vec3 Float
0 Float
1 Float
0
, $sel:depth:Plane :: Float
depth = Float
d
}
yzLeft :: Float -> Plane
yzLeft :: Float -> Plane
yzLeft Float
d = Plane :: Vec3 -> Float -> Plane
Plane
{ $sel:normal:Plane :: Vec3
normal = Float -> Float -> Float -> Vec3
vec3 (-Float
1) Float
0 Float
0
, $sel:depth:Plane :: Float
depth = Float
d
}
yzRight :: Float -> Plane
yzRight :: Float -> Plane
yzRight Float
d = Plane :: Vec3 -> Float -> Plane
Plane
{ $sel:normal:Plane :: Vec3
normal = Float -> Float -> Float -> Vec3
vec3 Float
1 Float
0 Float
0
, $sel:depth:Plane :: Float
depth = Float
d
}