00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ACTORNODE_H
00016 #define ACTORNODE_H
00017
00018 #include "pandabase.h"
00019 #include "physicalNode.h"
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 class EXPCL_PANDAPHYSICS ActorNode : public PhysicalNode {
00031 PUBLISHED:
00032 ActorNode(const string &name = "");
00033 ActorNode(const ActorNode ©);
00034 virtual ~ActorNode();
00035
00036 PhysicsObject *get_physics_object() { return _mass_center; }
00037
00038 void set_contact_vector(const LVector3 &contact_vector);
00039 const LVector3 &get_contact_vector() const;
00040
00041
00042
00043 void update_transform();
00044
00045 void set_transform_limit(PN_stdfloat limit) { _transform_limit = limit; };
00046 virtual void write(ostream &out, unsigned int indent=0) const;
00047
00048 private:
00049 PhysicsObject *_mass_center;
00050 LVector3 _contact_vector;
00051 bool _ok_to_callback;
00052 PN_stdfloat _transform_limit;
00053
00054
00055
00056 virtual void transform_changed();
00057 void test_transform(const TransformState *ts) const;
00058
00059 public:
00060 static TypeHandle get_class_type() {
00061 return _type_handle;
00062 }
00063 static void init_type() {
00064 PhysicalNode::init_type();
00065 register_type(_type_handle, "ActorNode",
00066 PhysicalNode::get_class_type());
00067 }
00068 virtual TypeHandle get_type() const {
00069 return get_class_type();
00070 }
00071 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00072
00073 private:
00074 static TypeHandle _type_handle;
00075
00076 };
00077
00078 #include "actorNode.I"
00079
00080 #endif // ACTORNODE_H