Added method to retrieve debug node from bullet world.

This commit is contained in:
enn0x 2013-02-25 20:41:43 +00:00
parent 21472cda9b
commit f3b4ba8fc8
3 changed files with 42 additions and 29 deletions

View File

@ -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

View File

@ -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

View File

@ -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);