setting linear damping using Oimo has no effect.
According to Oimo.js/RigidBody.js at gh-pages · lo-th/Oimo.js · GitHub … there is no such property as .linearDamping… on an Oimo rigidBody (physicsBody) object.
Oimo is a racing engine… not many luxury features.
Are you trying to keep the spheres from rolling-on forever?
Although a bit performance-hoggy, and probably NOT GOOD for > 1000 spheres… there IS a way to fake some sphere-roll friction/damping. It got named @RaananW’s Leather Boot… because Raanan was the first person around here… to suggest it, and it is very much like pushing a leather work boot against the spheres… to make them slow to a stop.
Now that all that fanfare is finished… https://www.babylonjs-playground.com/#OJVVA#24
I put all 20 spheres into allSpheres array, and then… see lines 32-37. Line 35 is an angularVelocity down-scaler… removing 15% of all spheres’ angular velocity… every frame (every physics world step, actually?). It will stop a sphere from rolling-down ANY steep mountainside, not a problem.
It runs constantly, even when no forces/spheres are physics-active. Do we care? Nah.
We COULD try something like… if (angularVelocity != Vector3.Zero()) then apply the brakes on THIS sphere some more. Else… it is already stopped. Not sure if that will improve perf alot… or hurt it. Maybe… if (!physicsBody.isSleeping) or similar, too… various ways to TRY to test for “already stopped so no more braking needed”.
I tried to use linear velocity/damping in line 34, but it killed the spheres’ gravity-drop speeds. ie. it sucked.
Ok, I hope I have been helpful. Others may have (better) ideas, so stay tuned.
Wingnut to the rescue
I wasn’t aware of any feature difference between physics engines.
Oimo is fast, that’s why i want to use it.
Thank you for the help!