Parcourir la source

Added method to retrieve debug node from bullet world.

enn0x il y a 13 ans
Parent
commit
f3b4ba8fc8

+ 37 - 0
panda/src/bullet/bulletWorld.I

@@ -54,6 +54,43 @@ INLINE BulletWorld::
   delete _broadphase;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: BulletWorld::set_debug_node
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletWorld::
+set_debug_node(BulletDebugNode *node) {
+
+  nassertv(node);
+
+  _debug = node;
+  _world->setDebugDrawer(&(_debug->_drawer));
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletWorld::clear_debug_node
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void BulletWorld::
+clear_debug_node() {
+
+  _debug = NULL;
+  _world->setDebugDrawer(NULL);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: BulletWorld::get_debug_node
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE BulletDebugNode *BulletWorld::
+get_debug_node() const {
+
+  return _debug;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: BulletWorld::get_world
 //       Access: Public

+ 0 - 26
panda/src/bullet/bulletWorld.cxx

@@ -258,32 +258,6 @@ sync_b2p() {
   }
 }
 
-////////////////////////////////////////////////////////////////////
-//     Function: BulletWorld::set_debug_node
-//       Access: Published
-//  Description:
-////////////////////////////////////////////////////////////////////
-void BulletWorld::
-set_debug_node(BulletDebugNode *node) {
-
-  nassertv(node);
-
-  _debug = node;
-  _world->setDebugDrawer(&(_debug->_drawer));
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BulletWorld::clear_debug_node
-//       Access: Published
-//  Description:
-////////////////////////////////////////////////////////////////////
-void BulletWorld::
-clear_debug_node() {
-
-  _debug = NULL;
-  _world->setDebugDrawer(NULL);
-}
-
 ////////////////////////////////////////////////////////////////////
 //     Function: BulletWorld::attach
 //       Access: Published

+ 5 - 3
panda/src/bullet/bulletWorld.h

@@ -61,11 +61,13 @@ PUBLISHED:
 
   int do_physics(PN_stdfloat dt, int max_substeps=1, PN_stdfloat stepsize=1.0f/60.0f);
 
-  void set_debug_node(BulletDebugNode *node);
-  void clear_debug_node();
-
   BulletSoftBodyWorldInfo get_world_info();
 
+  // Debug
+  INLINE void set_debug_node(BulletDebugNode *node);
+  INLINE void clear_debug_node();
+  INLINE BulletDebugNode *get_debug_node() const;
+
   // Attach/Remove
   void attach(TypedObject *object);
   void remove(TypedObject *object);