jit.phys.multiple change mass of individual object?
I have been trying this for a while now and am not getting anywhere... hope someone here with fresh eyes can help me out!!
I have a grid of spheres and I would like to be able to drop random ones. So far so good. I use jit.phys.multiple and jit.gl.multiple. I set the mass of all objects to 0, @filters none (I don't want the spheres to interact with each other), then randomly set the mass back to 1...
What I would like to happen next is that once a sphere has left the FOV that it is removed from the physics engine. I was trying to set the mass back to 0 but couldn't make it work. Also, each time I make another sphere fall, all previously fallen spheres reset and fall again... How do I tell jit.phys.multiple to ignore certain spheres and keep them at their current position off screen? Is there a good way of achieving this?
Here is the patch. Thanks so much in advance!!!
you'd probably be interested in the "sendbody" message. search the file browser for "phys.multiple.sendbody.maxpat"
Thanks, will have a look at this one again!
Hi there,
been trying to get this to work too, also with the sendbody method before checking the forum. It seems, this method works for native attributes of jit.gl.gridshape like rotatexyz, position, etc., though not for physparams like mass, force or restitution… these commands are simply ignored. Using matrices to control these attributes requires a reset of the position matrix to take effect which, as described above, results in resetting all shapes to their initial position. When using the output of the position matrix (of jit.phys.multiple) and resending this instead on every impulse, all masses and forces are reset too before being applied again. So I am pretty much stuck here, perhaps there is a clandestine setting which sensitizes the jit.phys.multiple to its special params when using the sendbody command?
Help need & appreciated. Thanks!
Does local_scaling 1 improve things? If not please provide a patch