Collision detection

Nov 8, 2011 at 12:16pm

Collision detection

Is it possible to have collision detection without the physics? I would like to be able to use the collision detection to trigger other kinds of events. Perhaps there is a way to set the physics so that they are not doing anything?

Hope this is clear what I am asking….

#59856
Nov 10, 2011 at 7:35am

you can set the gravity to “0 0 0″ if that is what you are asking.

#215458
Nov 10, 2011 at 5:18pm

hi markdavid. there are several options, but perhaps the easiest is to set @dynamics 0 on your jit.phys.world.
this will remove all dynamic forces from the simulation and still allow you to get notifications from colliding bodies.

an alternative is to set @mass 0 or @kinematic 1 on your jit.phys.bodies, which removes dynamic forces from individual bodies, instead of the whole simulation.

let me know if anything is unclear.

#215459
Nov 11, 2011 at 1:05am

thanks robert – I’ll try it out

#215460
Nov 14, 2011 at 6:39am

Hi Robert-
For some reason this is not doing what I expect. What I was hoping to achieve was to use collision detection to act as a sensor field around an object. For example, in the patch below I would like to be able sense the red an blue balls, but not knock them around.
thanks for your responses-
kind regards-
markdavid

– Pasted Max Patch, click to expand. –
#215461
Nov 14, 2011 at 7:10am

it’s a little difficult for me to tell what’s happening in your patch and what’s not working for you.

take a look at the patch below which shows how to setup a physics world for collisions only.
please let me know if you have further questions.

– Pasted Max Patch, click to expand. –
#215462
Nov 14, 2011 at 3:57pm

Thanks Robert-
that is helpful. I guess the best way to explain my patch is to say that I want my cake and eat it too. That is I want to mix dynamics -
I imagine a jit.phys.body with no dynamics could be used as an invisible sensor field that is larger than the body (this could be used for obstacle avoidance, for example)

Then a second jit.phys.body could be used to wrap dynamics around the object itself. This way if it didn’t manage to avoid the obstacle there would be consequences…

It was my understanding from your previous post that this might be possible:
“an alternative is to set @mass 0 or @kinematic 1 on your jit.phys.bodies, which removes dynamic forces from individual bodies, instead of the whole simulation.”

Hope this makes more sense…

BTW – I am very excited about these new features and having a lot of fun getting to know them :)

#215463
Nov 14, 2011 at 7:29pm

ok, i think i understand. this is actually another upcoming feature of the physics objects.
a future update will include an object called jit.phys.ghost, which will notify when other physics objects are colliding (your invisible sensor field) and allow you to apply forces to the colliding objects.

does this sound like what you need?

#215464
Nov 15, 2011 at 4:38am

Thanks for your response-
sounds like I should wait for the updates to find out :)

#215465

You must be logged in to reply to this topic.