collision filtering / jit.phys question

Jan 12, 2012 at 4:36pm

collision filtering / jit.phys question

Hey all,

I am currently attempting to use collision hits amongst rigid bodies to trigger audio events. My current problem lies in the ability to filter out “repeated” events from frame to frame; i.e., collisions are updated on account of their duration, so if a collision lasts longer than a single frame it gets reported multiple times. I’d like to filter out these multiple-reported collisions and only accept the “new” ones. I imagine there is some way to do this that I have yet to foresee. Perhaps by comparing reports from successive frames using dict.route? (storing the delayed frame in a second dictionary) or even something simpler? Any insight is appreciated.

Thanks,
Zach

#61205
Jan 12, 2012 at 6:57pm

hi Zach.
i thing the easiest way to determine if a collision is new, is to look at the duration field of the collision dict entry.
if it’s new, the duration will be 0.
check out the following example patch, and look inside the collision-sound sub-patch for a basic example of filtering new collisions.

Max6/examples/jitter-examples/render/physics/phys.picker.impulse.maxpat

let me know if you have other questions.

#220600
Apr 13, 2012 at 3:10pm

Hello Robert,

will it be possible in a next release of max to have:
1) an information on the velocity of the collision (or a force) at duration = 0 (the best will be to have this value for the 3 axis). I’ve used this information within Box2D to adjust the gain of a sound associated to a collision (this is not the case in phys.picker.impulse.maxpat); I will be happy to do the same with the Max6 physics objects.
2) a “collisions” arguments on jit.phys.body, jit.phys.ghost and jit.phys.multiple to handle collisions that are specific to the object through the rightest outlet. This way, it will be easer to filter collisions for a given object.

Best,

Jean-Michel

#220601
Apr 13, 2012 at 7:02pm

hi jean-michel. thanks for the suggestion.
you should be pleased to know that both these features are planned for a future update.

#220602
Mar 23, 2013 at 1:36am

Hi,
I pick up the thread : is there a way to know “intensity” of a collision between two bodies ?
thanks,

pry

#220603
Mar 28, 2013 at 2:14am

check out the impulse entry of the collisions dictionary

the following patch gives an example of using this:
Max 6.1/examples/jitter-examples/render/physics/phys.world.collision.impulse.maxpat

#220604
Mar 28, 2013 at 10:39pm

oups…
Many thanks Rob.

pry

#220605

You must be logged in to reply to this topic.