00001 // ///////////////////////////////////////////////////////////////////////////// 00002 // 00003 // Name: LightComponent.h 00004 // Author: Michael Bartsch (ZCCdark203) 00005 // 00006 // Desc : Declaration of the LightComponent class. 00007 // 00008 // License: Copyright (C) 2009 Michael Bartsch and Contributors 00009 // 00010 // This program is free software: you can redistribute it 00011 // and/or modify it under the terms of the zlib/libpng License. 00012 // See main.cpp for conditions of distribution and use. 00013 // 00014 // ///////////////////////////////////////////////////////////////////////////// 00015 00016 #ifndef __LIGHTCOMPONENT_H__ 00017 #define __LIGHTCOMPONENT_H__ 00018 00019 // Include files 00020 #include "../../dependencies.h" 00021 #include "SceneComponent.h" 00022 00023 00024 // LightComponent class 00026 class LightComponent : public SceneComponent 00027 { 00028 public: 00029 00030 // Initialisation and deinitialisation 00035 LightComponent(Entity *parent, const SColorf &color = SColorf(1.0f, 1.0f, 1.0f), 00036 f32 radius = 100.0f); 00038 ~LightComponent(); 00039 00040 // AngelScript binding 00043 static LightComponent* refFactory(Entity *parent); 00046 static LightComponent* refFactory(Entity *parent, const SColor &color, f32 radius); 00047 00048 // Methods 00050 ILightSceneNode* getLightSceneNode(); 00051 00053 bool getCastShadow() const; 00055 E_LIGHT_TYPE getLightType() const; 00057 f32 getRadius() const; 00058 00061 void setCastShadow(bool shadow = true); 00064 void setLightType(E_LIGHT_TYPE type); 00067 void setRadius(f32 radius); 00068 00069 private: 00070 00071 // Members 00072 ILightSceneNode *mLightSN; 00073 }; 00074 00075 00076 // LightComponent Angelscript binding. 00078 extern void bindLightComponent(asIScriptEngine *engine); 00079 00080 #endif