2D physics on a plane? #375
-
Hey! I am experimenting with the idea of using r3f and cannon to make a 2D environment with 2D physics with an orthographic camera. Currently, I want to have a bunch of 2d circles collide with and bounce off each other. Any ideas of how to achieve this? I do have an idea to use a cylinder to represent 2d circles. But the question is how to make them only move in collide in two detention (moving along the plane, in this case, the XY plane). Is there any way in three.js or cannon to natively ignore the physics on the Z-axis? If there's not, I guess I could set up constraints on the z-axis or a huge amount of gravity on the z-axis. Would this be a good plan? Any feedback is welcome!! Thank you so much. |
Beta Was this translation helpful? Give feedback.
Try https://github.com/pmndrs/use-p2