Light.h

Go to the documentation of this file.
00001 // Copyright (C) 2005 Dave Griffiths
00002 //
00003 // This program is free software; you can redistribute it and/or modify
00004 // it under the terms of the GNU General Public License as published by
00005 // the Free Software Foundation; either version 2 of the License, or
00006 // (at your option) any later version.
00007 //
00008 // This program is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 // GNU General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU General Public License
00014 // along with this program; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00016 
00017 #include <string>
00018 #include <assert.h>
00019 #include "dada.h"
00020 
00021 #ifndef FLUXUSLIGHT
00022 #define FLUXUSLIGHT
00023 
00024 namespace Fluxus
00025 {
00026 
00031 class Light
00032 {
00033 public:
00034     Light();
00035     virtual ~Light();
00039     void Render();
00041     
00042     enum Type {POINT,DIRECTIONAL,SPOT};
00043 
00047     void SetType(Type s) { m_Type=s; }
00048     void SetIndex(int s);
00049     void SetAmbient(dColour s);
00050     void SetDiffuse(dColour s);
00051     void SetSpecular(dColour s);
00052     void SetSpotAngle(float s);
00053     void SetSpotExponent(float s);
00054     void SetPosition(dVector s);
00055     void SetAttenuation(int type, float s);
00056     void SetDirection(dVector s);
00057     dVector GetPosition() { return m_Position; }
00059     
00065     void SetCameraLock(bool s)  { m_CameraLock=s; }
00066     bool GetCameraLock()   { return m_CameraLock; }
00068     
00069     
00070 protected:
00071 
00072     int m_Index;
00073     dColour m_Ambient;
00074     dColour m_Diffuse;
00075     dColour m_Specular;
00076     dVector m_Position;
00077     dVector m_Direction;
00078     
00079     Type m_Type;
00080     bool m_CameraLock;
00081     
00082 private:
00083     
00084     friend istream &operator>>(istream &s, Light &o);
00085     friend ostream &operator<<(ostream &s, Light &o);
00086 };
00087 
00088 istream &operator>>(istream &s, Light &o);
00089 ostream &operator<<(ostream &s, Light &o);
00090 
00091 };
00092 
00093 #endif

Generated on Tue Sep 4 23:22:18 2007 for The Fluxus Renderer (libfluxus) by  doxygen 1.5.1