Panda3D
|
00001 // Filename: decalEffect.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 DECALEFFECT_H 00016 #define DECALEFFECT_H 00017 00018 #include "pandabase.h" 00019 00020 #include "renderEffect.h" 00021 00022 class FactoryParams; 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : DecalEffect 00026 // Description : Applied to a GeomNode to indicate that the children 00027 // of this GeomNode are coplanar and should be drawn as 00028 // decals (eliminating Z-fighting). 00029 //////////////////////////////////////////////////////////////////// 00030 class EXPCL_PANDA_PGRAPH DecalEffect : public RenderEffect { 00031 private: 00032 INLINE DecalEffect(); 00033 00034 PUBLISHED: 00035 static CPT(RenderEffect) make(); 00036 00037 protected: 00038 virtual bool safe_to_combine() const; 00039 virtual int compare_to_impl(const RenderEffect *other) const; 00040 00041 public: 00042 static void register_with_read_factory(); 00043 virtual void write_datagram(BamWriter *manager, Datagram &dg); 00044 00045 protected: 00046 static TypedWritable *make_from_bam(const FactoryParams ¶ms); 00047 void fillin(DatagramIterator &scan, BamReader *manager); 00048 00049 public: 00050 static TypeHandle get_class_type() { 00051 return _type_handle; 00052 } 00053 static void init_type() { 00054 RenderEffect::init_type(); 00055 register_type(_type_handle, "DecalEffect", 00056 RenderEffect::get_class_type()); 00057 } 00058 virtual TypeHandle get_type() const { 00059 return get_class_type(); 00060 } 00061 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00062 00063 private: 00064 static TypeHandle _type_handle; 00065 }; 00066 00067 #include "decalEffect.I" 00068 00069 #endif 00070