7

I want to simulate some blocks falling, but more like wooden blocks that don't have any elasticity or rubberiness to them.

But I can't find settings that act like this. I've set restitution to 0 but there is still a lot of bounce when objects collide.

I've set contactEquationRelaxation low because otherwise things seem to deflate.

And I've set contactEquationStiffness low because otherwise everything just bumps into each other one time and flies off.

But it still doesn't feel right, like the heavy thud of a material that absorbs most of the energy and just drops to the floor.

Also even once almost stopped, multiple objects on top of each other flex a lot.

Here's my code, it's react-three-fiber but should still be the same properties as standard cannon.

Thanks!

<Canvas > 
                    
            <Physics gravity={[0, -10, 0]} 
                     defaultContactMaterial={
                       {
                         friction: 0.5, 
                         restitution: 0, 
                         contactEquationStiffness: 6000,
                         contactEquationRelaxation: 0.000001
                        }}>

                  <Shelf position={[0, -5, 0]} rotation={[-Math.PI / 2, 0, 0]}  />

                  {boxes}

            </Physics>

            <Static />

 </Canvas>
Jonathan Plackett
  • 2,346
  • 2
  • 20
  • 33

0 Answers0