Hi.
I have to detect if some body (sensor, may be invisible) was touched by another.
I must identify who touched the sensor body, to it can react to the right body (exploding, pushing, ec).
Using ghosts in this case could cause too much processing?
Thanks.
Jose
Mark some bodies to react on touch.
-
- Posts: 38
- Joined: Fri Aug 12, 2005 5:37 pm
Re: Mark some bodies to react on touch.
Well, I only need to know if the player touches some objects, so, in this case, I think that the best option is to have a ghost object attached to the player body.
-
- Posts: 77
- Joined: Thu Nov 26, 2009 6:32 pm
Re: Mark some bodies to react on touch.
Just use the void pointer available for each body using setUserPointer and getUserPointer. Since it is a a void pointer you can tag the body with anything.
-
- Posts: 237
- Joined: Tue Jun 29, 2010 10:27 pm
Re: Mark some bodies to react on touch.
This thread: http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=6897 might help.