Update: I was wrong about time-step NOT affecting stutter rates.
https://www.babylonjs-playground.com/#WWNQ10#28
Lines 50-51 play area.
scene.getPhysicsEngine().setTimeStep(1/120); stutter slow
scene.getPhysicsEngine().setTimeStep(1/20); stutter fast
Try these values…
scene.getPhysicsEngine().setTimeStep(1/5);
joint1.setMotor(1, 1);
Maxforce (2nd param) of 1. Rolls fine (it seems). Wowzers! YAY! The wheel could still be stuttering real fast. How would we know if so/not? 1/2 seems smoother than 1/5, so I’m thinking 1/5 IS still stuttering… just very fast. So is 1/2. Fast stuttering MIGHT be normal for physics engines. But probably not.
Could a guy ponder… that maybe Oimo is getting a rotten deltaTime, or maybe no deltaTime at all?
Perhaps it is taking a step… whenever our browser gets-around-to-it, instead of running on engine deltaTime? hmm. Perhaps we NEVER tell Oimo how/from-where to derive a step speed.
console.log(scene.getPhysicsEngine().getTimeStep()) = 0.016666666666666666 (by default) (1/60)
I think that value is a ratio to apply-to a time-feed, but NOT the actual time-feed from engine delta-time itself. (speculating) Interesting. Notice the CannonPlugin constructor doing deltaTime value-setting, and none happens in the OimoPlugin constructor. hmm.
Aside: Changing iterations value in line 28… seemingly no affect. Also, wheel still rotates in different directions… stable/latest. hmm.
Grand Finale: https://www.babylonjs-playground.com/#WWNQ10#30 Returned to sphereImpostor, double-size wheel, mass:10, timestep:1/2, maxforce:1… rolling fine! Yum! BEEF!
(Wingnut hugs Oimo for momentarily getting its shit together)
Don’t worry. We still have MANY problems. Older paddlewheel demo looks bad on a 1/5 timestep.
https://playground.babylonjs.com/#5W5B6W#60 Notice collision active ONLY on 2 paddles? I believe this is because collision-checking gets stupid… when rotation is struggling.
All in all, I think increasing time-step beyond 1/60… is a kludge-fix. It is not a solution or even close to it. But, maybe it is more evidence of SOMETHING. When we get it right, 1/60 will work as well as the 1/2 roll that we just witnessed. setMotor 1,1 should roll ANYTHING of ANY size/mass… as long as no collision/friction is present. Yes, it might take a long time to reach speed 1, but still… it should roll with a maxforce of 1. Maybe even 0.1 (imho - oimo).