Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

matter.js circular area with bodies inside

$
0
0

I'm trying to find a way to build a circular area with borders and put rigid bodies inside

Didn't find an easy way to make it.

There's one example of a terrain built from an SVG:

if (typeof $ !== 'undefined') {        $.get('./svg/terrain.svg').done(function(data) {            var vertexSets = [];            $(data).find('path').each(function(i, path) {                vertexSets.push(Svg.pathToVertices(path, 30));            });            terrain = Bodies.fromVertices(400, 350, vertexSets, {                isStatic: true,                render: {                    fillStyle: '#2e2b44',                    strokeStyle: '#2e2b44',                    lineWidth: 1                }            }, true);            World.add(world, terrain);        });    }

Am I right that I will have to use the same logic and add a lot of bodies (an approximation of PI) to build a circular area?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>