00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __BULLET_GHOST_NODE_H__
00016 #define __BULLET_GHOST_NODE_H__
00017
00018 #include "pandabase.h"
00019
00020 #include "bullet_includes.h"
00021 #include "bullet_utils.h"
00022 #include "bulletBodyNode.h"
00023
00024 #include "pandaNode.h"
00025 #include "collideMask.h"
00026
00027 class BulletShape;
00028
00029
00030
00031
00032
00033 class EXPCL_PANDABULLET BulletGhostNode : public BulletBodyNode {
00034
00035 PUBLISHED:
00036 BulletGhostNode(const char *name="ghost");
00037 INLINE ~BulletGhostNode();
00038
00039
00040 INLINE int get_num_overlapping_nodes() const;
00041 INLINE PandaNode *get_overlapping_node(int idx) const;
00042 MAKE_SEQ(get_overlapping_nodes, get_num_overlapping_nodes, get_overlapping_node);
00043
00044 public:
00045 virtual btCollisionObject *get_object() const;
00046
00047 void sync_p2b();
00048 void sync_b2p();
00049
00050 protected:
00051 virtual void parents_changed();
00052 virtual void transform_changed();
00053
00054 private:
00055 CPT(TransformState) _sync;
00056 bool _sync_disable;
00057 bool _sync_local;
00058
00059 btPairCachingGhostObject *_ghost;
00060
00061
00062 public:
00063 static TypeHandle get_class_type() {
00064 return _type_handle;
00065 }
00066 static void init_type() {
00067 BulletBodyNode::init_type();
00068 register_type(_type_handle, "BulletGhostNode",
00069 BulletBodyNode::get_class_type());
00070 }
00071 virtual TypeHandle get_type() const {
00072 return get_class_type();
00073 }
00074 virtual TypeHandle force_init_type() {
00075 init_type();
00076 return get_class_type();
00077 }
00078
00079 private:
00080 static TypeHandle _type_handle;
00081 };
00082
00083 #include "bulletGhostNode.I"
00084
00085 #endif // __BULLET_GHOST_NODE_H__
00086