Particle system + Physics
I am trying to build a particle system that obeys the jit.phys objects. I want the particles to be attracted to jit.plato objects by using jit.phys.ghost. I managed to do that by tweaking the Physics Patch-a-Day 5 (force system) and it works great. My only problem was the amount of particles; I wanted to have many more on my patch.
So I went on looking around in the forum and I came across the gen particle example. It’s perfect because I can get the exact amount of particles I want. I started tweaking it and removed the blackhole math from it. However, I don’t seem to be able to apply jit.phys.ghost forces on the particles created by the jit.gl.mesh object.
Is it possible to apply the jit.phys.ghost forces on the particles created by the jit.gl.mesh object ?
Any ideas anyone ?
Someone else asked a similar question http://cycling74.com/forums/topic/gen-particle-with-physics/ but the answer wasn’t clear enough.
So I made some progress. I inserted the jit.phys objects but as soon as I turn on the metro it causes Max to crash. Any ideas on this ? I’m stuck.
phys.ghost will only apply forces to rigid-bodies (phys.body or phys.multiple) in a phys.world simulation.
the particles generated by the gen patcher and rendered by the gl.mesh are simply vertices and have no representation in the phys.world.
you can send the particle matrix to phys.multiple, but you need to make the decisions about what kind of rigid-bodies these particles are, as described in the post you linked.
if you simply want forces applied to your gen-based particle system, you will have to roll your own using matrix-operators or gen.
@rob Thanks for the advice. I’ve made a lot of progress and this is what I ended up with.
My only problem here is the amount of particles. It seems to considerably slow down if you load more than 1000 particles. It might be my computer. Can someone else try this and check the performance?
Mac OS X 10.9.2
12 GB 1067 MHz DDR3
2.8 GHz i7
my only suggestion is to disable collisions between the particles, however this might not be the effect you are going for.
to do this, simply set the @filterclass of the phys.multiple to something like "pmult", and then set the @filters list of phys.multiple to something other than "pmult", eg "worldbox default" will allow the phys.multiple bodies to collide with the worldbox, and all other default rigid bodies, but not with each other.
we hope to be making some performance improvements for physics objects in the future.
"we hope to be making some performance improvements for physics objects in the future."
you mean GPU?
possibly, no details yet.