Hi guys! Welcome @Coming_Soon … pretty nice physics work… good job! I like it!
Up there, I’m goofing around with linearVelocity, angularVelocity, and damping. I made quite a few modifications… and left notes.
CS - notice that .setAngularVelocity() and .setLinearVelocity() happen on sphere.physicsImpostor… but .angularDamping and .linearDamping happen on sphere.physicsImpostor.physicsBody. I believe… physicsImpostor is a BabylonJS object (created by the CannonJS plugin for BJS), but physicsBody is a CannonJS “native” object. So, you see, you can “interface” with physics at the BJS plugin level, OR at the CannonJS “native” level. Knowing this… might be important to your physics work… later.
I’ve always liked native-level damping, because it does gradual “brakes”… but I don’t know if that’s what CS prefers. Still fun to play-with. The more 9’s you add to line 76, the faster it stops on key-up.
Note: The friction value that is sometimes used when adding physicsImpostors to sphere/mesh… doesn’t work very well for spheres, because spheres don’t have much ground surface-contact area. This is why damping is used with rolling spheres, quite often.
I believe there is an option for .fixedRotation nearby, too, if you want the sphere to “skid” instead of roll. Also, setting angularDamping to 1… and keeping it set there… might prevent sphere rolling.
Keep in mind that .linearDamping and .angularDamping are NATIVE properties on CannonJS Bodies… and so… are probably named/used differently… when NOT using CannonJS physics (when using Oimo or Ammo, for example).
Now CS knows all of our physics tricks and secrets. Time to issue CS a BabylonJS physics safety suit, helmet, and goggles. heh.