Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How many pixels is a meter in p2.js? #362

Open
ziarmandhost opened this issue Nov 14, 2020 · 3 comments
Open

How many pixels is a meter in p2.js? #362

ziarmandhost opened this issue Nov 14, 2020 · 3 comments

Comments

@ziarmandhost
Copy link

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
Copy link
Author

@schteppe please help to resolve this issue

@schteppe
Copy link
Owner

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

@ziarmandhost
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants