00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OpenSpace3D 00004 For the latest info, see http://www.openspace3d.com 00005 00006 Copyright (c) 2010 I-maginer 00007 00008 This program is free software; you can redistribute it and/or modify it under 00009 the terms of the GNU Lesser General Public License as published by the Free Software 00010 Foundation; either version 2 of the License, or (at your option) any later 00011 version. 00012 00013 This program is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License along with 00018 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00019 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00020 http://www.gnu.org/copyleft/lesser.txt 00021 00022 You may alternatively use this source under the terms of a specific version of 00023 the OpenSpace3D Unrestricted License provided you have obtained such a license from 00024 I-maginer. 00025 ----------------------------------------------------------------------------- 00026 */ 00027 00036 #ifndef __SO3LIGHT_H__ 00037 #define __SO3LIGHT_H__ 00038 00039 #include "../SCOLBasic/SO3Std.h" 00040 #include "../SO3SceneGraph/SO3NodeScol.h" 00041 00042 namespace SO3 00043 { 00044 00045 class SLight : public SNode 00046 { 00047 public: 00048 enum LightType 00049 { 00050 SO3_POINT_LIGHT = 0, 00051 SO3_DIRECTIONAL_LIGHT = 1, 00052 SO3_SPOTLIGHT_LIGHT = 2 00053 }; 00054 protected: 00055 private: 00056 Ogre::Light* O3Light; 00057 00058 public: 00062 SLight(SScene* parent, std::string lightName); 00063 00066 ~SLight(); 00067 00070 Ogre::Light* GetOgreLightPointer(); 00071 00074 void SetDiffuseColour(int diffuseColor); 00075 00078 int GetDiffuseColour(); 00079 00082 void SetSpecularColour(int specularColor); 00083 00086 int GetSpecularColour(); 00087 00090 void SetPowerScale(float powerScale); 00091 00094 float GetPowerScale(); 00095 00098 void SetVisible(bool isVisible); 00099 00102 bool GetVisible(); 00103 00106 void SetAttenuation(float range, float constant, float linear, float quadratic); 00107 00112 void SetAttenuation(float range); 00113 00116 Ogre::Vector4 GetAttenuation(); 00117 00120 void SLight::SetShadowFarDistance(float distance); 00121 00124 float GetShadowFarDistance(); 00125 00128 void SetType(LightType type); 00129 00132 LightType GetType(); 00133 00136 void SetSpotlightInnerAngle(float radianAngle); 00137 00140 float GetSpotlightInnerAngle(); 00141 00144 void SetSpotlightOuterAngle(float radianAngle); 00145 00148 float GetSpotlightOuterAngle(); 00149 00152 void SetSpotlightFalloff(float value); 00153 00156 float GetSpotlightFalloff(); 00157 00161 virtual void SetCastShadows(bool castShadows); 00162 00166 virtual bool GetCastShadows(); 00167 00171 virtual void SetRenderingDistance(float distance); 00172 00176 virtual float GetRenderingDistance(); 00177 00181 virtual Ogre::Vector3 GetBoundingBoxSize(bool childs = false); 00182 00186 virtual Ogre::Vector3 GetBoundingBoxCenter(bool childs = false); 00187 protected: 00188 private: 00192 SLight(); 00193 }; 00194 00195 } 00196 00197 #endif
1.6.3