chandlerprall / Physijs

Physics plugin for Three.js
MIT License
2.76k stars 455 forks source link

How to implement elastic collision between sphere and wall #133

Open lawkinming opened 10 years ago

lawkinming commented 10 years ago

Hi, I have implemented a page to test sphere-wall collision. (http://appsrv.cse.cuhk.edu.hk/~kmlaw0/test/examples/collisions.html) I want it to be elastic collision so I set all of the objects with 0 friction and 1 restitution.

But it is weird that the ball can not bounce back to the initial height, and when a ball hits the walls, sometimes it goes along the wall rather than bounce back. The reflection angle is weird too.

Is there any way to fix this?

mirekh commented 10 years ago

Mayby that wall is "glue-wall"? ...ok, just kidding.

chandlerprall commented 10 years ago

How do boxes react to the same collisions? If I recall, Bullet has/had a bug in the sphere restitution where some collisions would result in a sphere simply stopping.

EJTH commented 8 years ago

I have the same problems and it is driving me insane :( It works for box collisions though, but spheres seem to just stop when it touches a fixed object.