Sleeping objects coming alive when not hit

User avatar
jarno
Posts: 57
Joined: Tue Mar 16, 2010 1:42 am

Sleeping objects coming alive when not hit

Post by jarno »

I'm having an issue with sleeping objects becoming active even though they are not hit.

It appears that objects are awakened as soon as there is a collision manifold present involving them. But just because a manifold exists does not mean there is an actual collision. Some manifolds are coming back as having no contact points.

It's a problem for me as I use sleep objects to suspend them up in the air until they are hit. Now they start falling when a convex kinematic shape comes close, but not actually hits.

I'm not sure if this is a bug in a collision algorithm not removing empty manifolds, or a bug in the island manager not checking the number of contact points in a manifold.

---JvdL---
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm

Re: Sleeping objects coming alive when not hit

Post by dphil »

I believe it is intentional that sleeping objects awake when an active object enters their bounding box. I think this aids in efficiency and collision response calculations. I think the main problem here is that you probably shouldn't be using/relying on objects' sleeping state to keep them from responding to gravity (this seems to be what you are doing). Instead, I would use collision callbacks or some other manual check for collision to explicitly change object properties (such as enabling/disabling gravity) to do what you want.
Karrok
Posts: 65
Joined: Fri May 13, 2011 1:11 pm

Re: Sleeping objects coming alive when not hit

Post by Karrok »

dphil is correct,

If an object would only come out of its sleep state on an actual collision it might be (in some cases) too late.

If you are using collision isles (groups of collision objects) all the objects in a group wake up as soon as another object is detected within its bounding box. So the response is consistent.
User avatar
jarno
Posts: 57
Joined: Tue Mar 16, 2010 1:42 am

Re: Sleeping objects coming alive when not hit

Post by jarno »

Thanks for the replies.

Managing the object to avoid non-collision forces from being applied is doable I think. I also have some objects composed of parts with constraints between them which I want to keep still until hit, which might be a bit more tricky to handle. Probably keep those constraints inactive until collision.

---JvdL---