Search⌘ K
AI Features

Restitution and Friction

Explore how to apply restitution and friction properties to colliders in Three.js using Rapier. Understand how these affect the bouncing and sliding behavior of 3D objects in a scene, and learn to fine-tune interactions for realistic physics simulations.

Working with restitution and friction

In the following example, we’ll look a bit closer at the restitution and friction properties of the Collider provided by Rapier.

restitution is the property that defines how much energy an object keeps after it collides with another object. We can look at it a bit like bounciness. A tennis ball has high restitution, while a brick has low restitution.

friction defines how easily an object glides on top of another object. Objects with high friction slow down quickly when moving on top of another object, while objects with low friction can easily glide. Something such as ice has low friction, while sandpaper has high friction. ...