Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

light.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                         light.h  -  Dynamic lighting
00003                              -------------------
00004     begin                : Mon Nov 5 2001
00005     copyright            : (C) 2001 by Reality Rift Studios
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, light.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2001
00023  Reality Rift Studios. All Rights Reserved.
00024 
00025  ***************************************************************************/
00026 
00027 #ifndef __NELIGHT_H
00028 #define __NELIGHT_H
00029 
00030 
00031 #include "base.h"
00032 #include "sceneentity.h"
00033 #include "color.h"
00034 #include "nemath.h"
00035 
00036 
00043 namespace NeoEngine
00044 {
00045 
00046 
00057 class NEOENGINE_API Light : public SceneEntity
00058 {
00059     public:
00060 
00061         DefineVisitable();
00062 
00063 
00064     public:
00065 
00069         enum LIGHTTYPE
00070         {
00072           DIRECTIONAL                   = 0,
00073 
00075           POINT                         = 1,
00076 
00078           SPOT                          = 2,
00079 
00081           AMBIENT                       = 3
00082         };
00083 
00084 
00088         enum LIGHTFLAG
00089         {
00091           NOFLAGS                        = 0,
00092 
00094           CASTSHADOWS                    = 1
00095         };
00096 
00097 
00098     protected:
00099 
00101         LIGHTTYPE                       m_eType;
00102 
00104         int                             m_iFlags;
00105 
00106 
00107     public:
00108 
00110         Vector3d                        m_kDirection;
00111 
00113         Color                           m_kAmbient;
00114 
00116         Color                           m_kDiffuse;
00117 
00119         Color                           m_kSpecular;
00120 
00122         float                           m_fConstantAttenuation;
00123 
00125         float                           m_fLinearAttenuation;
00126 
00128         float                           m_fQuadraticAttenuation;
00129 
00130 
00136                                         Light( LIGHTTYPE eType, int iFlags = NOFLAGS, const Vector3d &rkDirection = Vector3d::ZERO );
00137 
00141         inline LIGHTTYPE                GetType() const { return m_eType; }
00142 
00146         inline int                      GetFlags() const { return m_iFlags; }
00147 
00151         Vector3d                        GetDirection();
00152 
00159         virtual bool                    Render( Frustum *pkFrustum = 0, bool bForce = false );
00160 };
00161 
00162 
00163 };
00164 
00165 
00166 #endif

Generated on Wed Jan 21 14:21:06 2004 for NeoEngine by doxygen 1.3.5