00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef COMPASSEFFECT_H
00020 #define COMPASSEFFECT_H
00021
00022 #include "pandabase.h"
00023
00024 #include "renderEffect.h"
00025 #include "luse.h"
00026 #include "nodePath.h"
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
00056
00057
00058
00059 class EXPCL_PANDA CompassEffect : public RenderEffect {
00060 private:
00061 INLINE CompassEffect();
00062
00063 PUBLISHED:
00064 enum Properties {
00065 P_x = 0x001,
00066 P_y = 0x002,
00067 P_z = 0x004,
00068 P_pos = 0x007,
00069 P_rot = 0x008,
00070 P_sx = 0x010,
00071 P_sy = 0x020,
00072 P_sz = 0x040,
00073 P_scale = 0x070,
00074 P_all = 0x07f,
00075 };
00076 static CPT(RenderEffect) make(const NodePath &reference,
00077 int properties = P_rot);
00078
00079 INLINE const NodePath &get_reference() const;
00080 INLINE int get_properties() const;
00081
00082 public:
00083 virtual bool safe_to_transform() const;
00084 virtual void output(ostream &out) const;
00085
00086 CPT(TransformState) do_compass(const TransformState *net_transform,
00087 const TransformState *node_transform) const;
00088
00089 protected:
00090 virtual int compare_to_impl(const RenderEffect *other) const;
00091
00092 private:
00093 NodePath _reference;
00094 int _properties;
00095
00096 public:
00097 static void register_with_read_factory();
00098 virtual void write_datagram(BamWriter *manager, Datagram &dg);
00099
00100 protected:
00101 static TypedWritable *make_from_bam(const FactoryParams ¶ms);
00102 void fillin(DatagramIterator &scan, BamReader *manager);
00103
00104 public:
00105 static TypeHandle get_class_type() {
00106 return _type_handle;
00107 }
00108 static void init_type() {
00109 RenderEffect::init_type();
00110 register_type(_type_handle, "CompassEffect",
00111 RenderEffect::get_class_type());
00112 }
00113 virtual TypeHandle get_type() const {
00114 return get_class_type();
00115 }
00116 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00117
00118 private:
00119 static TypeHandle _type_handle;
00120 };
00121
00122 #include "compassEffect.I"
00123
00124 #endif
00125