Sign in to follow this  
Andrey Zimin

Friction to stop the ball

Recommended Posts

Hiya AZ.  This question has happened before, and I love answering it.  I think it was @fenomas who first told us why this happens.

It's cuzzzzz... sphere's have very little surface area colliding with the ground.  No friction.

It would be the same way in real life, but especially true in an air-free environment such as a BJS scene.  :)  BJS is also known for its VERY VERY smooth ground-planes.  heh

My favorite way seen so far... is .linearDamping.  I think RaananW invented that property for us... because his work-boot got wore-out.  (more about that, below)  ;)

https://www.babylonjs-playground.com/#OJVVA#18

(line 32) 

There's another way... something like...

scene.beforeRender=function(){ sphere.physicsImpostor.physicsBody.linearVelocity.scaleEqual(.95) }  // applies a .05 drag-factor to the linear velocity.

The above method... has also been called "RaananW's Leather Work Boot"... because he first told us about it, and it is similar to pushing your shoe against the sphere... to slow it.  :)

I hope this helps.  Party on!

Share this post


Link to post
Share on other sites
36 minutes ago, Wingnut said:

Hiya AZ.  This question has happened before, and I love answering it.  I think it was @fenomas who first told us why this happens.

It's cuzzzzz... sphere's have very little surface area colliding with the ground.  No friction.

It would be the same way in real life, but especially true in an air-free environment such as a BJS scene.  :)  BJS is also known for its VERY VERY smooth ground-planes.  heh

My favorite way seen so far... is .linearDamping.  I think RaananW invented that property for us... because his work-boot got wore-out.  (more about that, below)  ;)

https://www.babylonjs-playground.com/#OJVVA#18

(line 32) 

There's another way... something like...

scene.beforeRender=function(){ sphere.physicsImpostor.physicsBody.linearVelocity.scaleEqual(.95) }  // applies a .05 drag-factor to the linear velocity.

The above method... has also been called "RaananW's Leather Work Boot"... because he first told us about it, and it is similar to pushing your shoe against the sphere... to slow it.  :)

I hope this helps.  Party on!

Thank You! I'm sure this is not the last time you answered that question. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.