00001 // Filename: ambientLight.h 00002 // Created by: mike (09Jan97) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef AMBIENTLIGHT_H 00020 #define AMBIENTLIGHT_H 00021 00022 #include "pandabase.h" 00023 00024 #include "lightNode.h" 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : AmbientLight 00028 // Description : A light source that seems to illuminate all points in 00029 // space at once. This kind of light need not actually 00030 // be part of the scene graph, since it has no meaningful 00031 // position. 00032 //////////////////////////////////////////////////////////////////// 00033 class EXPCL_PANDA AmbientLight : public LightNode { 00034 PUBLISHED: 00035 AmbientLight(const string &name); 00036 00037 protected: 00038 AmbientLight(const AmbientLight ©); 00039 00040 public: 00041 virtual PandaNode *make_copy() const; 00042 virtual void write(ostream &out, int indent_level) const; 00043 00044 public: 00045 virtual void bind(GraphicsStateGuardianBase *gsg, int light_id); 00046 00047 public: 00048 static void register_with_read_factory(); 00049 virtual void write_datagram(BamWriter *manager, Datagram &dg); 00050 00051 protected: 00052 static TypedWritable *make_from_bam(const FactoryParams ¶ms); 00053 void fillin(DatagramIterator &scan, BamReader *manager); 00054 00055 public: 00056 static TypeHandle get_class_type() { 00057 return _type_handle; 00058 } 00059 static void init_type() { 00060 LightNode::init_type(); 00061 register_type(_type_handle, "AmbientLight", 00062 LightNode::get_class_type()); 00063 } 00064 virtual TypeHandle get_type() const { 00065 return get_class_type(); 00066 } 00067 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00068 00069 private: 00070 static TypeHandle _type_handle; 00071 }; 00072 00073 INLINE ostream &operator << (ostream &out, const AmbientLight &light) { 00074 light.output(out); 00075 return out; 00076 } 00077 00078 #include "ambientLight.I" 00079 00080 #endif