Skip to content

How to keep pixels_per_meter in sync with window resize? #187

Answered by sebcrozet
Luminoth asked this question in Q&A
Discussion options

You must be logged in to vote

There is no way to change pixels_per_meter after the initialization of the bevy_rapier plugin. Making it modifiable implies one of the two following options:

  1. The complete internal state of rapier needs to be resized to fit the new sizes (because your 100px*100px*100px collider in bevy_rapier will now have a different size in meters in rapier).
  2. Or the internal state of bevy_rapier needs to be resized to fit the new pixel sizes (because you 1m*1m*1m collider in rapier new has a different size in pixels in bevy_rapier).

The option (1) would be far too expensive. The option (2) could be considered but will still be quite expensive since it involves modifying all the pixel-sized colliders an…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Luminoth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants