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