Physics engine in SuperCollider

I recently came across the TraerPhysics quark, ported to SuperCollider by redFrik from the TraerPhysics library for Processing written by Jeffrey Traer Bernstein.

I was thinking that it could be very useful for simulating real-world physical phenomena; however, what I believe is missing is a system for detecting collisions.

My original goal, which led me to discover the Traer library in the first place, was the desire to create an emulation of windchimes, waterfall chimes, toka or kabalonga. However, even though the Traer library is capable of generating and managing particle systems and their associated forces, how can one detect collisions between particles?

Because of this apparent limitation, I considered writing the simulation in Processing and calling scsynth via OSC to handle the sound component.

However, I would much prefer to stay entirely within SuperCollider. To this end, does anyone know of a quark that might be suitable for this purpose?

Thank you so much
n

1 Like

I think you could modify ParticleSystem and put a collision check that iterates over the particles in the tick function or use an external routine if you like.

1 Like

Thanks @mjsyts ,
yes, of course, this could definitely be a solution.

However, I had something slightly different in mind — something more, I’m not sure how to put it, systemic. Something like Erin Catto’s Box2D (I clearly remember having used the port of this library for Processing in the past).

An additional quark/library for SuperCollider that would basically implement Bodies (static, dynamic, or kinematic), Fixtures, Joints, and Shapes.

As far as you know, does anything similar exist in SuperCollider?

Sorry for the late reply. AFAIK it doesn’t exist. I would probably write your own classes for it if I were you. Wish I had a better answer. If you do, I’m sure someone else would appreciate it.

there is World_World, a game engine written in sclang. It does physics and collisions, in 2D