detecting "out-of-object" in jit.phys.picking ?

Vincent Goudard's icon

Hi,

I am trying to make a toggle out of a jit.phys.object, but I get stuck on a simple issue.

I would like the toggle to behave this way :

- the "click" is taken into account on mouseup

- the "click" is cancelled if mouseup is happening outside the object.

See patcher below for a (failing) demo.

It seems like contact information is near at hand (since it given on mouse down), but is missing for my aim...

Thanks

Vincent

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

Rob Ramirez's icon

seems to work more like you want if you disable dynamics on the phys.picker, no? and maybe also enable hover.

Vincent Goudard's icon

Thanks Rob, you're right, disabling dynamics prevent an output if the interaction is outside the object.

The problem is that I need dynamics (and output_positions) for other objects in my context (and worse : some objects that are not dynamic may become dynamic at some point).

So I would rather handle the problem locally (at a phys object level) than globally on the phys.picker.

Here is a workaround using hover, but I wish I could get rid of the delay.

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

Rob Ramirez's icon

hey Vincent, i'll see if there's anything that can be done to make this easier.