So I’m trying to apply friction to a physicsImpostor, like so:
let sphere = BABYLON.Mesh.CreateSphere('sphere', 8, 2, scene);
sphere.physicsImpostor = new BABYLON.PhysicsImpostor(sphere, BABYLON.PhysicsImpostor.SphereImpostor, {
mass: 30,
friction: 0.07,
restitution: 0
}, scene);
However, there is no sign that friction is affecting the velocity of the object (I’ve tested with low and high numbers). How would I implement this correctly?
Thanks in advance!
https://www.babylonjs-playground.com/#BEFOO#328
1 Like
Wingnut
December 29, 2018, 10:17pm
2
Hiya BattleSquid.
Spheres show no friction-effect… cuz WHY? Yep, not enough “contact” surface area. Billiard balls will roll across sandpaper, no problem.
sphere.physicsImpostor.physicsBody.linearDamping = 0.4;
That should work. Here’s an older post … which has a playground demo. Party on!
2 Likes
Worked like a charm! Thanks!
1 Like
linearDamping? But the sphere continues to rotate along the Y axis
Pryme8
February 5, 2020, 9:32pm
5
do angularDamping maybe
sphere.getPhysicsImpostor().physicsBody.angularDamping = 0.86
2 Likes