lambdacube-engine-0.2.1: Graphics/LambdaCube/Light.hs
module Graphics.LambdaCube.Light where
import Graphics.LambdaCube.Types
-- | Possible types of light sources.
data LightTypes
= LT_POINT -- ^ Point light sources give off light equally
-- in all directions, so they require only
-- position but no direction.
| LT_DIRECTIONAL -- ^ Directional lights simulate parallel light
-- beams from a distant source, hence have
-- direction but no position.
| LT_SPOTLIGHT -- ^ Spotlights simulate a cone of light from a
-- source so require position and direction, plus
-- extra values for falloff.
deriving (Eq,Ord,Show)
-- | Light source description.
data Light
= Light
{ lgType :: LightTypes
, lgDiffuse :: ColourValue
, lgSpecular :: ColourValue
, lgDirection :: Vec3
, lgSpotOuter :: FloatType
, lgSpotFalloff :: FloatType
, lgRange :: FloatType
, lgAttenuationConst :: FloatType
, lgAttenuationLinear :: FloatType
, lgAttenuationQuad :: FloatType
}
deriving (Eq,Show)