00001 //------------------------------------------------------------------------------ 00002 // Lamp : Open source game middleware 00003 // Copyright (C) 2004 Junpei Ohtani ( Email : junpee@users.sourceforge.jp ) 00004 // 00005 // This library is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // This library is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with this library; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 //------------------------------------------------------------------------------ 00019 00020 /** @file 00021 * アンビエントライトヘッダ 00022 * @author Junpee 00023 */ 00024 00025 #ifndef AMBIENT_LIHGT_H_ 00026 #define AMBIENT_LIHGT_H_ 00027 00028 #include <Graphics/Light/GlobalLight.h> 00029 00030 namespace Lamp{ 00031 00032 //------------------------------------------------------------------------------ 00033 /** 00034 * アンビエントライト 00035 */ 00036 class AmbientLight : public GlobalLight{ 00037 friend class LightManager; 00038 public: 00039 //-------------------------------------------------------------------------- 00040 /** 00041 * コピー 00042 * @param copyMask コピーマスク 00043 * @return コピーされたシーンリーフ 00044 */ 00045 virtual SceneLeaf* copy(u_int copyMask = 0) const{ 00046 return copyAmbientLight(); 00047 } 00048 00049 /** 00050 * コピー 00051 * @return コピーされたライト 00052 */ 00053 virtual Light* copyLight() const{ return copyAmbientLight(); } 00054 00055 /** 00056 * アンビエントライトのコピー 00057 * @return コピーされたモデル 00058 */ 00059 virtual AmbientLight* copyAmbientLight() const; 00060 00061 //-------------------------------------------------------------------------- 00062 /** 00063 * ライト色の設定 00064 * @param color ライト色 00065 */ 00066 virtual void setColor(const Color3f& color){ color_ = color; } 00067 00068 /** 00069 * ライト色の取得 00070 * @return ライト色 00071 */ 00072 virtual Color3f getColor() const{ return color_; } 00073 00074 //-------------------------------------------------------------------------- 00075 /** 00076 * アンビエントライトかどうか 00077 * @return アンビエントライトならtrue 00078 */ 00079 virtual bool isAmbientLight() const{ return true; } 00080 00081 protected: 00082 //-------------------------------------------------------------------------- 00083 /** 00084 * コンストラクタ 00085 * @param name 名前 00086 * @param scene シーン 00087 */ 00088 AmbientLight(const String& name, Scene* scene); 00089 00090 /** 00091 * デストラクタ 00092 */ 00093 virtual ~AmbientLight(); 00094 00095 //-------------------------------------------------------------------------- 00096 private: 00097 // カラー 00098 Color3f color_; 00099 }; 00100 00101 //------------------------------------------------------------------------------ 00102 } // End of namespace Lamp 00103 #endif // End of AMBIENT_LIHGT_H_ 00104 //------------------------------------------------------------------------------ 00105