00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef JOINTVERTEXTRANSFORM_H
00016 #define JOINTVERTEXTRANSFORM_H
00017
00018 #include "pandabase.h"
00019 #include "characterJoint.h"
00020 #include "vertexTransform.h"
00021 #include "pointerTo.h"
00022 #include "lightMutex.h"
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class EXPCL_PANDA_CHAR JointVertexTransform : public VertexTransform {
00039 private:
00040 JointVertexTransform();
00041
00042 PUBLISHED:
00043 JointVertexTransform(CharacterJoint *joint);
00044 virtual ~JointVertexTransform();
00045
00046 INLINE const CharacterJoint *get_joint() const;
00047
00048 virtual void get_matrix(LMatrix4 &matrix) const;
00049 virtual void mult_matrix(LMatrix4 &result, const LMatrix4 &previous) const;
00050 virtual void accumulate_matrix(LMatrix4 &accum, PN_stdfloat weight) const;
00051
00052 virtual void output(ostream &out) const;
00053
00054 private:
00055 INLINE void check_matrix() const;
00056 void compute_matrix();
00057
00058 PT(CharacterJoint) _joint;
00059
00060 LMatrix4 _matrix;
00061 bool _matrix_stale;
00062 LightMutex _lock;
00063
00064 public:
00065 static void register_with_read_factory();
00066 virtual void write_datagram(BamWriter *manager, Datagram &dg);
00067 virtual int complete_pointers(TypedWritable **plist, BamReader *manager);
00068
00069 protected:
00070 static TypedWritable *make_from_bam(const FactoryParams ¶ms);
00071 void fillin(DatagramIterator &scan, BamReader *manager);
00072
00073 public:
00074 static TypeHandle get_class_type() {
00075 return _type_handle;
00076 }
00077 static void init_type() {
00078 VertexTransform::init_type();
00079 register_type(_type_handle, "JointVertexTransform",
00080 VertexTransform::get_class_type());
00081 }
00082 virtual TypeHandle get_type() const {
00083 return get_class_type();
00084 }
00085 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00086
00087 private:
00088 static TypeHandle _type_handle;
00089
00090 friend class CharacterJoint;
00091 };
00092
00093 #include "jointVertexTransform.I"
00094
00095 #endif