collision filtering / jit.phys question

    Jan 12 2012 | 4:36 pm
    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

    • Jan 12 2012 | 6:57 pm
      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.
      let me know if you have other questions.
    • Apr 13 2012 | 3:10 pm
      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.
    • Apr 13 2012 | 7:02 pm
      hi jean-michel. thanks for the suggestion. you should be pleased to know that both these features are planned for a future update.
    • Mar 23 2013 | 1:36 am
      Hi, I pick up the thread : is there a way to know "intensity" of a collision between two bodies ? thanks,
    • Mar 28 2013 | 2:14 am
      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/
    • Mar 28 2013 | 10:39 pm
      oups... Many thanks Rob.