chandlerprall / Physijs

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

Is it possible to set restitution on objects? #336

Open fionchadd opened 4 months ago

fionchadd commented 4 months ago

I'm working on a thing at the moment that I want to eventually be like rolling a ball around a pool table.

I've got some of the way there, but when I move the sphere and it hits a wall, it just stays there.

I was wondering if there's a way to set restitution on objects like in matter.js for example? Or whether I need to detect the collision event and try and write the physics myself?

I've looked through various documentation but I'm struggling to find anything.

My codepen here if it's helpful: https://codepen.io/fionchadd/pen/JjzVNOe/4ba15559a770ceda5d9eee881c244b04

Thanks! Hannah