p2.js icon indicating copy to clipboard operation
p2.js copied to clipboard

How many pixels is a meter in p2.js?

Open ziarmandhost opened this issue 4 years ago • 3 comments

I am developing a game, but cant figure it out, so please i need some koefficient to convert pixels -> meters and meters -> pixel. I am using p2.js with pixi.js v5

ziarmandhost avatar Nov 14 '20 22:11 ziarmandhost

@schteppe please help to resolve this issue

ziarmandhost avatar Nov 14 '20 22:11 ziarmandhost

Hello! Try to choose a coefficient so your physics objects are around 1 meter in size. This is what p2 is optimized for.

schteppe avatar Nov 15 '20 17:11 schteppe

Hello! Try to choose a coefficient so your physics objects are around 1 meter in size. This is what p2 is optimized for.

I'm sorry I didn't react right away, I just tried to set the same value in the engine as in pixels, but still I would like some more concise solution, maybe you have it? I just need a function to convert pixels to meters, this is very important

ziarmandhost avatar Feb 06 '21 16:02 ziarmandhost