packages feed

lambdacube-engine-0.1.1: Graphics/LambdaCube/Light.hs

module Graphics.LambdaCube.Light where

import Graphics.LambdaCube.Types

-- | Defines the type of light
data LightTypes
    = LT_POINT          -- ^ Point light sources give off light equally in all directions, so require only position not 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
    
data Light
    = Light
    { lgType                    :: LightTypes
    , lgDiffuse                 :: ColourValue
    , lgSpecular                :: ColourValue
--        Vector3 mPosition;
--        Vector3 mDirection;
    , lgSpotOuter               :: FloatType
    , lgSpotInner               :: FloatType
    , lgSpotFalloff             :: FloatType
    , lgRange                   :: FloatType
    , lgAttenuationConst        :: FloatType
    , lgAttenuationLinear       :: FloatType
    , lgAttenuationQuad         :: FloatType
    , lgPowerScale              :: FloatType
--        size_t mIndexInFrame;
--    , lgOwnShadowFarDist    :: Bool
--    , lgShadowFarDist           :: FloatType
--    , lgShadowFarDistSquared    :: FloatType
--    , lgShadowNearClipDist      :: FloatType
--    , lgShadowFarClipDist       :: FloatType
    }
    
{-

        mutable Vector3 mDerivedPosition;
        mutable Vector3 mDerivedDirection;
		// Slightly hacky but unless we separate observed light render state from main Light...
		mutable Vector3 mDerivedCamRelativePosition;
		mutable bool mDerivedCamRelativeDirty;
		Camera* mCameraToBeRelativeTo;

        /// Shared class-level name for Movable type
        static String msMovableType;

        mutable PlaneBoundedVolume mNearClipVolume;
        mutable PlaneBoundedVolumeList mFrustumClipVolumes;
        /// Is the derived transform dirty?
        mutable bool mDerivedTransformDirty;

		/// Pointer to a custom shadow camera setup
		mutable ShadowCameraSetupPtr mCustomShadowCameraSetup;

		typedef map<uint16, Vector4>::type CustomParameterMap;
		/// Stores the custom parameters for the light
        CustomParameterMap mCustomParameters;
-}