This physics example demonstrates different ways of animating static Cannon bodies. I.e., they have
- The Flippers and Spring launcher are compound shapes and react to keyboard presses.
- The Bumpers implement the
onCollideevent to quickly scale the mesh to give it the impression that it is quickly expanding and contracting when something bumps into it.
- The Ball implements the
onCollideevent to multiply its current velocity by 10 in case it hits a Bumper.
- The Sliding Box is animated left and right, over time by subscribing to the Cannon Body API position property.
git clone https://github.com/Sean-Bradley/React-Three-Fiber-Boilerplate.git cd React-Three-Fiber-Boilerplate git checkout pinball npm install npm start