I am attempting to use Oimo.js in a non-Babylon project. I became aware of Oimo.js because of its inclusion in Babylon.js.
In my project, I have noticed that ‘friction’ doesn’t really behave as you would expect, and it seems to maybe not work at all. This has been reported by other users to the Oimo.js repo:
In these examples, they are talking about Sphere and plane collision which I understand a sphere may not respect friction. However, in my examples, I am doing Box-Plane collisions.
I have discussed with the maintainer of Oimo.js and they suggest it could be a bug and broken:
There are no tests on Oimo.js to prove or disprove its correctness. The examples don’t use any friction. Additionally, there is barely any documentation to demonstrate how to use it.
I’m opening this topic thread because I’m wondering if there are any Oimo-Babylon examples that actually use friction so I can confirm if it works or not. I highly respect Babylon and assuming that the inclusion of Oimo.js was because its legit.
Big playground, sorry. Line 1564 dictates that the mass on the pretty-colored “wheel”… should be 10.
Line 1583 reports that the wheel has a mass of 5235+. Not looking healthy, in that respect.
And as you can see, our Oimo setMotor for Oimo joints… is not working good when maxForce is set low. We are currently working that issue… or at least I am. You can change line 1590 maxForce value from 13541… to 13542, and the joint starts rolling just fine. Go fig. It has been seen long ago, rotating fine with a value of 6.
Got questions? Just holler. But no questions about why mass is wrong or why our setMotor is broken. We (I) don’t know the answers to those questions, yet. Stay in touch, and please tell us things you learn. We’ll do the same.
IMPORTANT EXTRA: Remember to avoid using rolling spheres for friction testing, because they don’t have enough surface contact with ground… to show friction effects/affects. For slowing-the-roll of spheres, we use either Oimo-provided damping features, or we constantly multiply the sphere’s physicsBody angular or linear velocity * 0.98… which burns-off a little speed each frame/physics-step.
PG - lines 72-74… show some slight linearDamping. I think either linearDamping OR angularDamping will work for slowing the spheres. All in all, spheres are not a good place to test for friction. Billiard balls roll across sandpaper… with hardly a notice.
I’m an emotional mess over there… wondering about the answer to your same question. Personally, I don’t know what we’re running from moment to moment. Sorry. @trevordev, @RaananW, @Deltakosh, @JohnK, we’ll ping 'em all… see if anyone has version info.
I don’t think we ran a minified version of Oimo… until about 10 days ago. Our REVISION number is 1.0.9, I think… but yeah, it could easily be a slightly-modified version of 1.0.9… before the minify.
I’m scared. I could easily say wrong things, here. Let’s listen for more-informed folk.
You can test out a limited use of friction at Use Forces - Babylon.js Documentation in the playground in that section switch to Oimo (lines 37 to 39) and try different friction values (both non zero) and contact points and direct the impulse along x axis see if the box reacts as you want it to.