Panda3D
|
00001 // Filename: fogAttrib.h 00002 // Created by: drose (14Mar02) 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 FOGATTRIB_H 00016 #define FOGATTRIB_H 00017 00018 #include "pandabase.h" 00019 00020 #include "renderAttrib.h" 00021 #include "fog.h" 00022 00023 //////////////////////////////////////////////////////////////////// 00024 // Class : FogAttrib 00025 // Description : Applies a Fog to the geometry at and below this node. 00026 //////////////////////////////////////////////////////////////////// 00027 class EXPCL_PANDA_PGRAPH FogAttrib : public RenderAttrib { 00028 private: 00029 INLINE FogAttrib(); 00030 00031 PUBLISHED: 00032 static CPT(RenderAttrib) make(Fog *fog); 00033 static CPT(RenderAttrib) make_off(); 00034 static CPT(RenderAttrib) make_default(); 00035 00036 INLINE bool is_off() const; 00037 INLINE Fog *get_fog() const; 00038 00039 public: 00040 virtual void output(ostream &out) const; 00041 00042 protected: 00043 virtual int compare_to_impl(const RenderAttrib *other) const; 00044 00045 private: 00046 PT(Fog) _fog; 00047 00048 PUBLISHED: 00049 static int get_class_slot() { 00050 return _attrib_slot; 00051 } 00052 virtual int get_slot() const { 00053 return get_class_slot(); 00054 } 00055 00056 public: 00057 static void register_with_read_factory(); 00058 virtual void write_datagram(BamWriter *manager, Datagram &dg); 00059 virtual int complete_pointers(TypedWritable **plist, BamReader *manager); 00060 00061 protected: 00062 static TypedWritable *make_from_bam(const FactoryParams ¶ms); 00063 void fillin(DatagramIterator &scan, BamReader *manager); 00064 00065 public: 00066 static TypeHandle get_class_type() { 00067 return _type_handle; 00068 } 00069 static void init_type() { 00070 RenderAttrib::init_type(); 00071 register_type(_type_handle, "FogAttrib", 00072 RenderAttrib::get_class_type()); 00073 _attrib_slot = register_slot(_type_handle, 100, make_default); 00074 } 00075 virtual TypeHandle get_type() const { 00076 return get_class_type(); 00077 } 00078 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00079 00080 private: 00081 static TypeHandle _type_handle; 00082 static int _attrib_slot; 00083 }; 00084 00085 #include "fogAttrib.I" 00086 00087 #endif 00088