Blob Sallad for Android
I found this little blob engine code, and converted it run on Android with Kotlin. See the WPF dot.Net version.
Blob Sallad
From the website:Original version by: Björn Lindberg
See the writeup at Dev.Opera
Blob Sallad — Canvas Tag and JavaScript Physics Simulation Experiment
Sample code
Here's the code that calculates the Verlet Integration to integrate Newton's equations of motion, as used in the Störmer method.
fun move(dt: Float) {
val dt2 = dt * dt
val currX = pos.x
val prevX = prev.x
val accX = _force.x / mass
prev.x = currX
pos.x = (2.0f - friction) * currX - (1.0f - friction) * prevX + accX * dt2
val currY = pos.y
val prevY = prev.y
val accY = _force.y / mass
prev.y = currY
pos.y = (2.0f - friction) * currY - (1.0f - friction) * prevY + accY * dt2
}