00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef COMPASSEFFECT_H
00016 #define COMPASSEFFECT_H
00017
00018 #include "pandabase.h"
00019
00020 #include "renderEffect.h"
00021 #include "luse.h"
00022 #include "nodePath.h"
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 class EXPCL_PANDA_PGRAPH CompassEffect : public RenderEffect {
00056 private:
00057 INLINE CompassEffect();
00058
00059 PUBLISHED:
00060 enum Properties {
00061 P_x = 0x001,
00062 P_y = 0x002,
00063 P_z = 0x004,
00064 P_pos = 0x007,
00065 P_rot = 0x008,
00066 P_sx = 0x010,
00067 P_sy = 0x020,
00068 P_sz = 0x040,
00069 P_scale = 0x070,
00070 P_all = 0x07f,
00071 };
00072 static CPT(RenderEffect) make(const NodePath &reference,
00073 int properties = P_rot);
00074
00075 INLINE const NodePath &get_reference() const;
00076 INLINE int get_properties() const;
00077
00078 public:
00079 virtual bool safe_to_transform() const;
00080 virtual void output(ostream &out) const;
00081
00082 virtual bool has_cull_callback() const;
00083 virtual void cull_callback(CullTraverser *trav, CullTraverserData &data,
00084 CPT(TransformState) &node_transform,
00085 CPT(RenderState) &node_state) const;
00086
00087 virtual bool has_adjust_transform() const;
00088 virtual void adjust_transform(CPT(TransformState) &net_transform,
00089 CPT(TransformState) &node_transform,
00090 PandaNode *node) const;
00091
00092 protected:
00093 virtual int compare_to_impl(const RenderEffect *other) const;
00094
00095 private:
00096 NodePath _reference;
00097 int _properties;
00098
00099 public:
00100 static void register_with_read_factory();
00101 virtual void write_datagram(BamWriter *manager, Datagram &dg);
00102
00103 protected:
00104 static TypedWritable *make_from_bam(const FactoryParams ¶ms);
00105 void fillin(DatagramIterator &scan, BamReader *manager);
00106
00107 public:
00108 static TypeHandle get_class_type() {
00109 return _type_handle;
00110 }
00111 static void init_type() {
00112 RenderEffect::init_type();
00113 register_type(_type_handle, "CompassEffect",
00114 RenderEffect::get_class_type());
00115 }
00116 virtual TypeHandle get_type() const {
00117 return get_class_type();
00118 }
00119 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00120
00121 private:
00122 static TypeHandle _type_handle;
00123 };
00124
00125 #include "compassEffect.I"
00126
00127 #endif
00128