Hello everyone!
I am using react-native-game-engine and matter-js for my application and I want to render a shape of my SVG element for example. On the react-native side it works great because I just show it inside my renderer component with react-native-svg. But the issue is that I also need a matter-js physic body to have the same shape in order for physics to work correctly.
I tried using Matter.Bodies.fromVertices method, but have a lot of issues during SVG conversion, so that was unsuccessful. I also found this guide https://www.codeandweb.com/physicseditor/tutorials/how-to-create-physics-shapes-for-phaser-3-and-matterjs, but it won't work because it is using Matter.Render and I am using react-native-game-engine instead.
So the question is how to render custom shapes and what is the preferable way to create them? Maybe tree-js will fit better for that?
Hello everyone!
I am using
react-native-game-engineandmatter-jsfor my application and I want to render a shape of my SVG element for example. On thereact-nativeside it works great because I just show it inside my renderer component withreact-native-svg. But the issue is that I also need amatter-jsphysic body to have the same shape in order for physics to work correctly.I tried using
Matter.Bodies.fromVerticesmethod, but have a lot of issues during SVG conversion, so that was unsuccessful. I also found this guide https://www.codeandweb.com/physicseditor/tutorials/how-to-create-physics-shapes-for-phaser-3-and-matterjs, but it won't work because it is usingMatter.Renderand I am usingreact-native-game-engineinstead.So the question is how to render custom shapes and what is the preferable way to create them? Maybe
tree-jswill fit better for that?