Collision detection

Mark-David Hosale's icon

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....

foobert's icon

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

Rob Ramirez's icon

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.

Mark-David Hosale's icon

thanks robert - I'll try it out

Mark-David Hosale's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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

Rob Ramirez's icon

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

Max Patch
Copy patch and select New From Clipboard in Max.

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.

Mark-David Hosale's icon

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 :)

Rob Ramirez's icon

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?

Mark-David Hosale's icon

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