Activate On Hit

The Igors
Posts: 4
Joined: Sat Jul 31, 2010 10:30 am

Activate On Hit

Post by The Igors »

Hi All

I want some object(s) inactive until other one (dynamic or kinematic) hits/bumps it. I tried setActivationState(ISLAND_SLEEPING) but it has effect only if all dynamic objects have this flag on. Otherwise IslandManager unions objects and clears ISLAND_SLEEPING state (don't know why). To prevent this I set CF_NO_CONTACT_RESPONSE flag. Now objects are sleeping Ok but need to restore response on hit. So I set gContactAddCallback to my routine that clears CF_NO_CONTACT_RESPONSE. It works but implementation looks ugly, for example I must do const_cast in MyContactAddCallback for arguments :|

Is there a better way to implement this?

Thanks