hello,
I'm currently trying to make a ragdoll without using bullet dynamics. (I am using ode dynamics). I would like to use bullet collisions, but cannot find a way to make the forearm and upperarm (for example) not collide without using a dynamics world. I apologize if this question has been answered already, but I couldn't find an answer when searching in the forums.
Basically, what I have found is this: when using a dynamics world, you can use the function "addConstraint( param1, disableCollisionsBetweenLinkedBodies=true )" to get this to work. However, the only "linked bodies" info I can find for a collisionworld is the compound shape. As far as I understand, using compound shapes reduces the performance drastically (at least in the program I tried).
Does anyone know of a way to disable the collisions between linked bodies for a collision world?
thanks.
ragdoll collisions
-
- Posts: 6
- Joined: Wed Sep 19, 2007 10:09 pm
- Location: California, USA
-
- Posts: 109
- Joined: Thu Dec 14, 2006 4:27 pm
- Location: Colombia
Re: ragdoll collisions
If you take look the btDiscreteDynamicsWorld class you will see this function prototype:
When adding constraints (joints), don't forget set the second parameter to true.
I also recommend take a look to the GenericJointDemo in Bullet; it implements ragdols with 6DOF joints which work much better that the existing joints in the ODE library.
Code: Select all
void addConstraint(btTypedConstraint* constraint, bool disableCollisionsBetweenLinkedBodies=false);
I also recommend take a look to the GenericJointDemo in Bullet; it implements ragdols with 6DOF joints which work much better that the existing joints in the ODE library.
-
- Posts: 6
- Joined: Wed Sep 19, 2007 10:09 pm
- Location: California, USA
Re: ragdoll collisions
Thanks for responding. however, I know about the function for the dynamics world. I'm curious if there is a way to make the adjacent bodies not collide for a ragdoll for the collision world.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: ragdoll collisions
Hi,
Yes this is possible, when just using Bullet collision detection, without the dynamics.
The best is to create a custom 'btOverlapFilterCallback', override the 'needBroadphaseCollision' and register it to the btOverlappingPairCache:
You will need to return 'false' when you don't want a collision to happen given a pair of objects.
Hope this helps,
Erwin
Yes this is possible, when just using Bullet collision detection, without the dynamics.
The best is to create a custom 'btOverlapFilterCallback', override the 'needBroadphaseCollision' and register it to the btOverlappingPairCache:
Code: Select all
struct btOverlapFilterCallback
{
virtual ~btOverlapFilterCallback()
{}
// return true when pairs need collision
virtual bool needBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const = 0;
};
Code: Select all
class btOverlappingPairCache
{
[...]
void setOverlapFilterCallback(btOverlapFilterCallback* callback)
{
m_overlapFilterCallback = callback;
}
Erwin
-
- Posts: 6
- Joined: Wed Sep 19, 2007 10:09 pm
- Location: California, USA
Re: ragdoll collisions
Yes, that looks good.
Thank you,
Ben
Thank you,
Ben
-
- Posts: 6
- Joined: Wed Sep 19, 2007 10:09 pm
- Location: California, USA
Re: ragdoll collisions
Does anyone know of a tutorial for btBroadphaseProxy objects? I would like to see an example of how they are created and used with existing geometries, if possible.
thanks.
thanks.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: ragdoll collisions
Hi,
If you add a btCollisionObject using btCollisionWorld::addCollisionObject, it will automatically create a broadphase proxy.
This means, you can get from a btBroadphaseProxy to btCollisionObject using:
Hope this helps,
Erwin
If you add a btCollisionObject using btCollisionWorld::addCollisionObject, it will automatically create a broadphase proxy.
Code: Select all
collisionObject->setBroadphaseHandle( getBroadphase()->createProxy(
minAabb,
maxAabb,
type,
collisionObject,
collisionFilterGroup,
collisionFilterMask
)) ;
Code: Select all
btCollisionObject* colObj0 = (btCollisionObject*)broadphaseProxy0->m_clientObject;
Erwin
-
- Posts: 6
- Joined: Wed Sep 19, 2007 10:09 pm
- Location: California, USA
Re: ragdoll collisions
Thanks for all the help. Do you know if there will be a demo with ODE using Bullet Collisions in an upcoming release of Bullet? I've looked at the test_BulletODE.cpp, but it seems to have a runtime error (could not load accelerators) so it doesn't help me much.
thanks.
thanks.