Hello folks,
I just migrated to bullet 2.75 and some of my collisions stopped working. If I simple recompile my project using version 2.74 everything works fine.
The collisions are between dynamic rigid bodies (boxes) and meshes, also actors (kinematic capsule) against mesh.
Note that only some objects do not collide anymore, the others works fine.
Any tips how I can debug this?
Thank you
Bruno Sanches
Some collisions not working on 2.75
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Some collisions not working on 2.75
The axis aligned bounding box (AABB) of static objects are not automatically updated after being added to the dynamics world.
Can you verify if this is your problem, by commenting out line 165 in Bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp?
If so, please add the line
after you changed static objects.
Hope this helps,
Erwin
Can you verify if this is your problem, by commenting out line 165 in Bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp?
Code: Select all
void btCollisionWorld::updateAabbs()
{
BT_PROFILE("updateAabbs");
btTransform predictedTrans;
for ( int i=0;i<m_collisionObjects.size();i++)
{
btCollisionObject* colObj = m_collisionObjects[i];
//only update aabb of active objects
// if (colObj->isActive())
{
updateSingleAabb(colObj);
}
}
}
Code: Select all
world-> updateSingleAabb(object);
Hope this helps,
Erwin
-
- Posts: 10
- Joined: Mon Feb 02, 2009 2:15 pm
Re: Some collisions not working on 2.75
Erwin,
this fixed the issue .
Some static objects get updated after being added to the world due to my load process, but now I simple force a AABB update when this happens.
Thank you!
Cheers
Bruno Sanches
this fixed the issue .
Some static objects get updated after being added to the world due to my load process, but now I simple force a AABB update when this happens.
Thank you!
Cheers
Bruno Sanches
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Some collisions not working on 2.75
To avoid such problems, the optimizations has been disabled by default.
Developers have to explicitly make a call to enable the optimization using
An updated Bullet 2.75 will be re-uploaded right now.
Thanks for the report,
Erwin
Developers have to explicitly make a call to enable the optimization using
Code: Select all
///enable optimization: only update the axis aligned bounding box of active objects
world->setForceUpdateAllAabbs(false);
Thanks for the report,
Erwin
-
- Posts: 10
- Joined: Mon Feb 02, 2009 2:15 pm
Re: Some collisions not working on 2.75
Thats great!
I updated mine here and did the testing:
1 - Disabled my changes (that updated static objects AABB) and tried it: worked without any issue
2 - Called world->setForceUpdateAllAabbs(false) and ran it again, as expected the "errors" came back
3 - Enabled my changes (now static AABB is updated when objects move) and it worked again without issues.
I do not know bullet implementation details and this may sound stupid, but how about adding a dirty flag to the objects? When we change its transform it turns ON the flag and that loop that updates AABB may check that flag also.
Just my 2 cents .
Thank you
Cheers
Bruno Sanches
I updated mine here and did the testing:
1 - Disabled my changes (that updated static objects AABB) and tried it: worked without any issue
2 - Called world->setForceUpdateAllAabbs(false) and ran it again, as expected the "errors" came back
3 - Enabled my changes (now static AABB is updated when objects move) and it worked again without issues.
I do not know bullet implementation details and this may sound stupid, but how about adding a dirty flag to the objects? When we change its transform it turns ON the flag and that loop that updates AABB may check that flag also.
Just my 2 cents .
Thank you
Cheers
Bruno Sanches
-
- Posts: 14
- Joined: Fri Jul 10, 2009 4:48 am
Re: Some collisions not working on 2.75
Just out of curiosity, is there a definitive list which specifies all of these optimisation settings we can toggle to get the best possible speed? I've discovered some profiling macros by accident which are ON by default, and being short on hardware resources (as most game developers are), I'd love to run a leaner/faster version of Bullet. Knowing exactly what to toggle/disable would really help game developers.Erwin Coumans wrote:To avoid such problems, the optimizations has been disabled by default.
Developers have to explicitly make a call to enable the optimization usingAn updated Bullet 2.75 will be re-uploaded right now.Code: Select all
///enable optimization: only update the axis aligned bounding box of active objects world->setForceUpdateAllAabbs(false);
Thanks for the report,
Erwin
Cheers,
Zenja
-
- Posts: 6
- Joined: Tue Sep 15, 2009 2:32 pm
Re: Some collisions not working on 2.75
"discovered some profiling macros by accident which are ON by default"
So.... which macros were they?
So.... which macros were they?
-
- Posts: 14
- Joined: Fri Jul 10, 2009 4:48 am
Re: Some collisions not working on 2.75
LinearMath/btQuickprof.h/line 19,
//#define BT_NO_PROFILE
//#define BT_NO_PROFILE