Panda3D
 All Classes Functions Variables Enumerations
bulletGhostNode.h
1 // Filename: bulletGhostNode.h
2 // Created by: enn0x (19Nov10)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef __BULLET_GHOST_NODE_H__
16 #define __BULLET_GHOST_NODE_H__
17 
18 #include "pandabase.h"
19 
20 #include "bullet_includes.h"
21 #include "bullet_utils.h"
22 #include "bulletBodyNode.h"
23 
24 #include "pandaNode.h"
25 #include "collideMask.h"
26 
27 class BulletShape;
28 
29 ////////////////////////////////////////////////////////////////////
30 // Class : BulletGhostNode
31 // Description :
32 ////////////////////////////////////////////////////////////////////
33 class EXPCL_PANDABULLET BulletGhostNode : public BulletBodyNode {
34 
35 PUBLISHED:
36  BulletGhostNode(const char *name="ghost");
37  INLINE ~BulletGhostNode();
38 
39  // Overlapping
40  INLINE int get_num_overlapping_nodes() const;
41  INLINE PandaNode *get_overlapping_node(int idx) const;
42  MAKE_SEQ(get_overlapping_nodes, get_num_overlapping_nodes, get_overlapping_node);
43 
44 public:
45  virtual btCollisionObject *get_object() const;
46 
47  void sync_p2b();
48  void sync_b2p();
49 
50 protected:
51  virtual void parents_changed();
52  virtual void transform_changed();
53 
54 private:
55  CPT(TransformState) _sync;
56  bool _sync_disable;
57  bool _sync_local;
58 
59  btPairCachingGhostObject *_ghost;
60 
61 ////////////////////////////////////////////////////////////////////
62 public:
63  static TypeHandle get_class_type() {
64  return _type_handle;
65  }
66  static void init_type() {
67  BulletBodyNode::init_type();
68  register_type(_type_handle, "BulletGhostNode",
69  BulletBodyNode::get_class_type());
70  }
71  virtual TypeHandle get_type() const {
72  return get_class_type();
73  }
74  virtual TypeHandle force_init_type() {
75  init_type();
76  return get_class_type();
77  }
78 
79 private:
80  static TypeHandle _type_handle;
81 };
82 
83 #include "bulletGhostNode.I"
84 
85 #endif // __BULLET_GHOST_NODE_H__
86 
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85