Video: http://www.youtube.com/watch?v=wwNJ3gM8-Bo
I have a btRigidBody with positive mass on top of another btRigidBody. I scale my body dynamically, but the object that is on top of it doesn't fall down when it is not on top of my other (scaled) object.
I have to translate it in order for it to fall. I did manifolds to check collisions and it is always colliding from below.
Does somebody knows an alternative way to solve this? Thanks.
setLocalScaling bug when scaling a shape
-
- Posts: 171
- Joined: Sun Jan 17, 2010 4:47 am
Re: setLocalScaling bug when scaling a shape
It may be deactivating when it comes to rest on top of the other object. If so you will have to disable it's deactivation, or force it as active.
Based on your video though, it almost looks like you may be using it as a character(btKinematicCharacterController). If that is the case then it could be many, many more things and I'm not sure where to begin.
Based on your video though, it almost looks like you may be using it as a character(btKinematicCharacterController). If that is the case then it could be many, many more things and I'm not sure where to begin.
-
- Posts: 26
- Joined: Sat Jun 15, 2013 2:29 am
Re: setLocalScaling bug when scaling a shape
Both of my bodies are with DISABLE_DEACTIVATION flags. And the character isn't a kinematic character, it is a btRigidBody with mass 1. The only weird thing my character (the colored box) has is (0, 0, 0) as angular factor.Mako_energy02 wrote:It may be deactivating when it comes to rest on top of the other object. If so you will have to disable it's deactivation, or force it as active.
Based on your video though, it almost looks like you may be using it as a character(btKinematicCharacterController). If that is the case then it could be many, many more things and I'm not sure where to begin.
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: setLocalScaling bug when scaling a shape
Hi,
i guess scaling doesn't invalidate the manifold cache as dynamic scaling is
is not a property of Rigid Body Simulation.
In general, if you want to make a Mario64 like game you need to use a custom character controller (CC).
Otherwise you run into a lot of problems you can't solve in Bullet Rigid Body Simulation.
I suggest to use the Bullet CC as a starting point.
i guess scaling doesn't invalidate the manifold cache as dynamic scaling is
is not a property of Rigid Body Simulation.
In general, if you want to make a Mario64 like game you need to use a custom character controller (CC).
Otherwise you run into a lot of problems you can't solve in Bullet Rigid Body Simulation.
I suggest to use the Bullet CC as a starting point.
-
- Posts: 26
- Joined: Sat Jun 15, 2013 2:29 am
Re: setLocalScaling bug when scaling a shape
You might be right about the character controller, but this shouldn't happen, right?pico wrote:Hi,
i guess scaling doesn't invalidate the manifold cache as dynamic scaling is
is not a property of Rigid Body Simulation.
In general, if you want to make a Mario64 like game you need to use a custom character controller (CC).
Otherwise you run into a lot of problems you can't solve in Bullet Rigid Body Simulation.
I suggest to use the Bullet CC as a starting point.
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: setLocalScaling bug when scaling a shape
You might be right about the character controller, but this shouldn't happen, right?[/quote]
When a Rigid Body is dynamically scaled it's no more a Rigid Body, so i wouldn't expect it to work.
What should happen with the contacts anyway? Should they move with scaling? Should they introduce friction?
I don't think Bullet or other Physics Engines Rigid Bodies solvers do take such behavior into account.
Sorry for no better reply
When a Rigid Body is dynamically scaled it's no more a Rigid Body, so i wouldn't expect it to work.
What should happen with the contacts anyway? Should they move with scaling? Should they introduce friction?
I don't think Bullet or other Physics Engines Rigid Bodies solvers do take such behavior into account.
Sorry for no better reply
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: setLocalScaling bug when scaling a shape
Before you make any change to the collision shape (replace shape, resize etc) you need to
1) remove the rigid body from the world
2) make the change (resize etc)
3) re-insert the body into the world
Alternatively you can flush the contact points manually for the object involved:
dynamicsWorld->getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(body->getBroadphaseHandle(), dynamicsWorld->getDispatcher());
1) remove the rigid body from the world
2) make the change (resize etc)
3) re-insert the body into the world
Alternatively you can flush the contact points manually for the object involved:
dynamicsWorld->getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(body->getBroadphaseHandle(), dynamicsWorld->getDispatcher());