bullet: fix various unprotected debug() prints

This commit is contained in:
rdb 2019-08-14 15:07:06 +02:00
parent c54f964a3b
commit 0e27f19d94
3 changed files with 15 additions and 8 deletions

View File

@ -61,7 +61,9 @@ contact_added_callback(btManifoldPoint &cp,
PT(PandaNode) node1 = (PandaNode *)obj1->getUserPointer(); PT(PandaNode) node1 = (PandaNode *)obj1->getUserPointer();
#endif #endif
if (bullet_cat.is_debug()) {
bullet_cat.debug() << "contact added: " << cp.m_userPersistentData << std::endl; bullet_cat.debug() << "contact added: " << cp.m_userPersistentData << std::endl;
}
// Gather persistent data // Gather persistent data
UserPersistentData *data = new UserPersistentData(); UserPersistentData *data = new UserPersistentData();
@ -123,8 +125,9 @@ contact_processed_callback(btManifoldPoint &cp,
*/ */
static bool static bool
contact_destroyed_callback(void *userPersistentData) { contact_destroyed_callback(void *userPersistentData) {
if (bullet_cat.is_debug()) {
bullet_cat.debug() << "contact removed: " << userPersistentData << std::endl; bullet_cat.debug() << "contact removed: " << userPersistentData << std::endl;
}
UserPersistentData *data = (UserPersistentData *)userPersistentData; UserPersistentData *data = (UserPersistentData *)userPersistentData;

View File

@ -384,8 +384,9 @@ drawTriangle(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2, cons
*/ */
void BulletDebugNode::DebugDraw:: void BulletDebugNode::DebugDraw::
drawTriangle(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2, const btVector3 &n0, const btVector3 &n1, const btVector3 &n2, const btVector3 &color, btScalar alpha) { drawTriangle(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2, const btVector3 &n0, const btVector3 &n1, const btVector3 &n2, const btVector3 &color, btScalar alpha) {
if (bullet_cat.is_debug()) {
bullet_cat.debug() << "drawTriangle(2) - not yet implemented!" << std::endl; bullet_cat.debug() << "drawTriangle(2) - not yet implemented!" << std::endl;
}
} }
/** /**
@ -405,8 +406,9 @@ drawContactPoint(const btVector3 &point, const btVector3 &normal, btScalar dista
*/ */
void BulletDebugNode::DebugDraw:: void BulletDebugNode::DebugDraw::
draw3dText(const btVector3 &location, const char *text) { draw3dText(const btVector3 &location, const char *text) {
if (bullet_cat.is_debug()) {
bullet_cat.debug() << "draw3dText - not yet implemented!" << std::endl; bullet_cat.debug() << "draw3dText - not yet implemented!" << std::endl;
}
} }
/** /**

View File

@ -207,7 +207,9 @@ init_libbullet() {
// Initialize notification category // Initialize notification category
bullet_cat.init(); bullet_cat.init();
if (bullet_cat.is_debug()) {
bullet_cat.debug() << "initialize module" << std::endl; bullet_cat.debug() << "initialize module" << std::endl;
}
// Register the Bullet system // Register the Bullet system
PandaSystem *ps = PandaSystem::get_global_ptr(); PandaSystem *ps = PandaSystem::get_global_ptr();