Hello,
I have another issue when implementing conveyors through a friction callback. Once they are stopped, I would like the objects to go to sleep to prevent a stack ob objects lying on the conveyor from hopping around or even destabilize.
Once the conveyor moves again, I need the whole sleeping island to be reactivated. Unfortunately, at the moment of conveyor reactivation, I only know the body of the conveyor, the other bodies are unknown to the context.
Is there a function to tell a whole island, especially alle its bodies to wake up?
Thank you very much in advance!
Cheers, Georg.
How to reactivate sleeping collision islands
-
- Posts: 11
- Joined: Tue Sep 16, 2008 9:34 am
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: How to reactivate sleeping collision islands
Just take any of the rigid bodies in the island, and call rigidbody->activate() on it. It will automatically activate all objects in the island.
Hope this helps,
Erwin
Hope this helps,
Erwin
-
- Posts: 11
- Joined: Tue Sep 16, 2008 9:34 am
Re: How to reactivate sleeping collision islands
Hi Erwin,
thanks for the reply. I am having a static object(with bullet 2.71) that is set up as conveyor with a modified collision callback. It looks like it is not part of the island the dynamic objects are in that are lying on top of the conveyor. So once I want to reactivate the island calling activate() on the conveyor, nothing happens.
Maybe to reactivate a sleeping island ist not the thing I want to do?
Thanks in advance, bullet is great. Georg.
thanks for the reply. I am having a static object(with bullet 2.71) that is set up as conveyor with a modified collision callback. It looks like it is not part of the island the dynamic objects are in that are lying on top of the conveyor. So once I want to reactivate the island calling activate() on the conveyor, nothing happens.
Maybe to reactivate a sleeping island ist not the thing I want to do?
Thanks in advance, bullet is great. Georg.
-
- Posts: 1
- Joined: Sat Nov 10, 2007 2:10 pm
Re: How to reactivate sleeping collision islands
Hi,
I'm having somewhat of a similar problem. When I remove an object from a sleeping island, it does not activate to re-evaluate if any of the sleeping object were resting on the object which was removed.
Looking into the code, I discover that btCollisionWorld->getCollisionObjectArray() seems to contain a lists of lists of the collision objects. Would calling activate() on the first element that is not the same element as the one being removed, solve the problem?
Cheers,
Simon
Edit:
secondwish: Could you not simply store one of the colliding objects from the custom collision-event, and then just call activate() on that one when your static body starts moving?
I'm having somewhat of a similar problem. When I remove an object from a sleeping island, it does not activate to re-evaluate if any of the sleeping object were resting on the object which was removed.
Looking into the code, I discover that btCollisionWorld->getCollisionObjectArray() seems to contain a lists of lists of the collision objects. Would calling activate() on the first element that is not the same element as the one being removed, solve the problem?
Cheers,
Simon
Edit:
secondwish: Could you not simply store one of the colliding objects from the custom collision-event, and then just call activate() on that one when your static body starts moving?
-
- Posts: 11
- Joined: Tue Sep 16, 2008 9:34 am
Re: How to reactivate sleeping collision islands
Hi simpeman,
thank you for your proposal, I think it will lead to a parallel storing of sleeping islands as I would have to somewhat keep a copy of the island with the conveyor. I think there is a better solution on activation of sleeping bodies in 274, but the friction callback is gone for performance reasons. So whats the solution with the friction callbacks or just a moving surface vector distribution (straight conveyor is all the same over the surface, curved conveyor is a distribution of surface vectors.
thank you for your proposal, I think it will lead to a parallel storing of sleeping islands as I would have to somewhat keep a copy of the island with the conveyor. I think there is a better solution on activation of sleeping bodies in 274, but the friction callback is gone for performance reasons. So whats the solution with the friction callbacks or just a moving surface vector distribution (straight conveyor is all the same over the surface, curved conveyor is a distribution of surface vectors.
-
- Posts: 2
- Joined: Sat Oct 10, 2009 7:35 am
Re: How to reactivate sleeping collision islands
Hi secondwish,
Have you tried 2.75 and find any solution to implement the conveyor moving?
It seems that there used to be a contact material modification API for us to use, which is gone in 2.75. You can see this post:
http://www.bulletphysics.org/Bullet/php ... 7e66b61de0
I came across a same situation where straight conveyor and curved conveyor are needed...but have no clue now how to implement it (I'm new to Bulllet...)
Have you tried 2.75 and find any solution to implement the conveyor moving?
It seems that there used to be a contact material modification API for us to use, which is gone in 2.75. You can see this post:
http://www.bulletphysics.org/Bullet/php ... 7e66b61de0
I came across a same situation where straight conveyor and curved conveyor are needed...but have no clue now how to implement it (I'm new to Bulllet...)
secondwish wrote:Hi simpeman,
thank you for your proposal, I think it will lead to a parallel storing of sleeping islands as I would have to somewhat keep a copy of the island with the conveyor. I think there is a better solution on activation of sleeping bodies in 274, but the friction callback is gone for performance reasons. So whats the solution with the friction callbacks or just a moving surface vector distribution (straight conveyor is all the same over the surface, curved conveyor is a distribution of surface vectors.