Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
E:/Programming/MyProject/K_Game_hg/GameEngine/include/render/Light.h
Go to the documentation of this file.
00001 // Copyright 2006-2011 by Kat'Oun
00002 
00003 #ifndef _LIGHT_H_
00004 #define _LIGHT_H_
00005 
00006 #include <EngineConfig.h>
00007 #include <core/Types.h>
00008 #include <scene/Node.h>
00009 #include <render/LightDefines.h>
00010 #include <render/Color.h>
00011 
00012 namespace render
00013 {
00014 
00016 class ENGINE_PUBLIC_EXPORT Light: public scene::Node
00017 {
00018 public:
00019 
00020         Light();
00021         Light(const std::string& name);
00022 
00023         ~Light();
00024 
00025         inline Light& operator=(const Light& other);
00026 
00027         void setLightType(LightType type);
00028         LightType getLightType();
00029 
00030         void setAmbientColor(f32 red, f32 green, f32 blue);
00031         void setAmbientColor(const render::Color& color);
00032         const render::Color& getAmbientColor() const;
00033 
00034         void setDiffuseColor(f32 red, f32 green, f32 blue);
00035         void setDiffuseColor(const render::Color& color);
00036         const render::Color& getDiffuseColor() const;
00037 
00038         void setSpecularColor(f32 red, f32 green, f32 blue);
00039         void setSpecularColor(const render::Color& color);
00040         const render::Color& getSpecularColor() const;
00041 
00042         void setAttenuation(f32 range, f32 constant, f32 linear, f32 quadratic);
00043         void setAttenuationRange(f32 range);
00044         void setAttenuationConstant(f32 constant);
00045         void setAttenuationLinear(f32 linear);
00046         void setAttenuationQuadric(f32 quadratic);
00047         f32 getAttenuationRange() const;
00048         f32 getAttenuationConstant() const;
00049         f32 getAttenuationLinear() const;
00050         f32 getAttenuationQuadric() const;
00051 
00052         void setSpotlightRange(f32 innerAngle, f32 outerAngle, f32 falloff);
00053         void setSpotlightInnerAngle(f32 innerAngle);
00054         void setSpotlightOuterAngle(f32 outerAngle);
00055         void setSpotlightFalloff(f32 falloff);
00056         f32 getSpotlightInnerAngle() const;
00057         f32 getSpotlightOuterAngle() const;
00058         f32 getSpotlightFalloff() const;
00059 
00060         void setPowerScale(f32 power);
00061         f32 getPowerScale() const;
00062 
00063         void setVisible(bool visible);
00064         bool isVisible();
00065 
00066 private:
00067 
00068         // Incremented count for next index
00069         static u32 msNextGeneratedLightIndex;
00070 
00071         void initProperties();
00072 
00073         LightType mLightType;
00074 
00075         render::Color mAmbient;
00076         render::Color mDiffuse;
00077         render::Color mSpecular;
00078 
00079         f32 mSpotOuter;
00080         f32 mSpotInner;
00081         f32 mSpotFalloff;
00082         f32 mRange;
00083         f32 mAttenuationConst;
00084         f32 mAttenuationLinear;
00085         f32 mAttenuationQuad;
00086         f32 mPowerScale;
00087 
00088         bool mVisible;
00089 };
00090 
00091 } //namespace render
00092 
00093 #endif

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:04 by Doxygen (1.7.4)