Jump to content

Friction to stop the ball


Andrey Zimin
 Share

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!

Link to comment
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. :)

Link to comment
Share on other sites

  • 1 year later...
On 2/13/2018 at 3:08 PM, 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!

Good solution for a flat ground.

But it doesn't work in an little bit inclinated floor.

(Maybe a ball can stop while is running down from the hill by the friction with grass)

Do you know some other trick to solve it also for inclinated floor?

Thanks

Link to comment
Share on other sites

  • 4 weeks later...
On 8/23/2019 at 11:15 AM, Marcuzhet said:

Good solution for a flat ground.

But it doesn't work in an little bit inclinated floor.

(Maybe a ball can stop while is running down from the hill by the friction with grass)

Do you know some other trick to solve it also for inclinated floor?

Thanks

Hi @Marcuzhet, please post your question on the new forum:
https://forum.babylonjs.com/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...