Forums > Jitter

jit.phys "looped" snake pit

June 6, 2013 | 12:42 pm

hi list,

i would like to make a "looped" snake pit, starting from Ben Bracken nice example (http://cycling74.com/2012/09/19/00-physics-patch-a-day/), but I faild to do it with jit.phys.multiple.

I managed to get something working with separate bodies, but this does not feels handy, and the FPS get quite low…

I can imagine this may be better optimized when using jit.phys.multiple, but the snake get stucked when I make the 2 ends meet (see patch below).

I guess I must set some values in the internal constraint matrix, but cannot really find how… Is there a documentation on that somewhere ?

<pre><code>

– Pasted Max Patch, click to expand. –

</code></pre>


June 7, 2013 | 12:02 pm

you can close the snake by creating an external jit.phys.6dof (or whatever constraint) and setting the @body1 and @body2 attributes to the name of the first and last phys.multiple instances.

you should give your phys.multiple a name, like @name snake.
then send to your new phys.6dof: @body1 snake_0, @body2 snake_9


Viewing 2 posts - 1 through 2 (of 2 total)