-
Is there a best way to keep bevy_rapier's pixels_per_meter sync'd with window resizes when not using ScalingMode::WindowSize ? It seems like pixels_per_meter makes sense when using that scaling mode (the Bevy default) but not when using any of the other scaling modes, which will change the pixels_per_meter every time a resize happens. Or is that something that's already accounted for behind the scenes? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There is no way to change
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 and as wall as all the transform, velocity, and force-related components affected by a rigid/body or collider. The last option is for you to deal with the pixels-to-meter conversion: you set 1 pixel = 1 meter (and express your graphics elements in meters), and the you setup a camera to zoom the scene to the visual size that works for you. |
Beta Was this translation helpful? Give feedback.
There is no way to change
pixels_per_meter
after the initialization of thebevy_rapier
plugin. Making it modifiable implies one of the two following options:rapier
needs to be resized to fit the new sizes (because your100px*100px*100px
collider inbevy_rapier
will now have a different size in meters inrapier
).bevy_rapier
needs to be resized to fit the new pixel sizes (because you1m*1m*1m
collider inrapier
new has a different size in pixels inbevy_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…