00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://ogre.sourceforge.net/ 00006 00007 Copyright © 2000-2002 The OGRE Team 00008 Also see acknowledgements in Readme.html 00009 00010 This program is free software; you can redistribute it and/or modify it under 00011 the terms of the GNU Lesser General Public License as published by the Free Software 00012 Foundation; either version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License along with 00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00022 http://www.gnu.org/copyleft/lesser.txt. 00023 ----------------------------------------------------------------------------- 00024 */ 00025 #ifndef _LIGHT_H__ 00026 #define _LIGHT_H__ 00027 00028 #include "OgrePrerequisites.h" 00029 00030 #include "OgreColourValue.h" 00031 #include "OgreVector3.h" 00032 #include "OgreString.h" 00033 #include "OgreMovableObject.h" 00034 00035 namespace Ogre { 00036 00037 00060 class _OgreExport Light : public MovableObject 00061 { 00062 public: 00064 enum LightTypes 00065 { 00067 LT_POINT, 00069 LT_DIRECTIONAL, 00071 LT_SPOTLIGHT 00072 }; 00073 00076 Light(); 00077 00080 Light(String name); 00081 00084 ~Light(); 00085 00088 const String& getName(void) const; 00089 00092 void setType(LightTypes type); 00093 00096 LightTypes getType(void); 00097 00107 void setDiffuseColour(Real red, Real green, Real blue); 00108 00118 void setDiffuseColour(const ColourValue& colour); 00119 00122 ColourValue getDiffuseColour(void); 00123 00133 void setSpecularColour(Real red, Real green, Real blue); 00134 00144 void setSpecularColour(const ColourValue& colour); 00145 00148 ColourValue getSpecularColour(void); 00149 00169 void setAttenuation(Real range, Real constant, Real linear, Real quadratic); 00170 00173 Real getAttenuationRange(void); 00174 00177 Real getAttenuationConstant(void); 00178 00181 Real getAttenuationLinear(void); 00182 00185 Real getAttenuationQuadric(void); 00186 00193 void setPosition(Real x, Real y, Real z); 00194 00201 void setPosition(const Vector3& vec); 00202 00207 Vector3 getPosition(void); 00208 00215 void setDirection(Real x, Real y, Real z); 00216 00223 void setDirection(const Vector3& vec); 00224 00229 Vector3 getDirection(void); 00230 00239 void setSpotlightRange(Real innerAngle, Real outerAngle, Real falloff = 1.0); 00240 00243 Real getSpotlightInnerAngle(void); 00244 00247 Real getSpotlightOuterAngle(void); 00248 00251 Real getSpotlightFalloff(void); 00252 00255 bool isModified(void); 00256 00259 void _clearModified(void); 00260 00262 void _notifyCurrentCamera(Camera* cam); 00263 00265 const AxisAlignedBox& getBoundingBox(void) const; 00266 00268 void _updateRenderQueue(RenderQueue* queue); 00269 00271 const String getMovableType(void) const; 00272 00274 const Vector3& getDerivedPosition(void); 00275 00277 const Vector3& getDerivedDirection(void); 00278 00284 void setVisible(bool visible); 00285 00286 00287 00288 00289 private: 00290 String mName; 00291 00292 LightTypes mLightType; 00293 Vector3 mPosition; 00294 ColourValue mDiffuse; 00295 ColourValue mSpecular; 00296 00297 Vector3 mDirection; 00298 00299 Real mSpotOuter; 00300 Real mSpotInner; 00301 Real mSpotFalloff; 00302 Real mRange; 00303 Real mAttenuationConst; 00304 Real mAttenuationLinear; 00305 Real mAttenuationQuad; 00306 00307 bool mModified; 00308 00309 Vector3 mDerivedPosition; 00310 Vector3 mDerivedDirection; 00312 Quaternion mLastParentOrientation; 00313 Vector3 mLastParentPosition; 00314 00316 static String msMovableType; 00317 00318 00319 00320 }; 00321 } // Namespace 00322 #endif
Copyright © 2002 by The OGRE Team