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

Colliders on Bevy meshes don't respect scale on initial tick #417

Open
spoorn opened this issue Aug 11, 2023 · 1 comment
Open

Colliders on Bevy meshes don't respect scale on initial tick #417

spoorn opened this issue Aug 11, 2023 · 1 comment
Labels
A-Geometry A-Integration very bevy specific C-Bug Something isn't working D-Medium P-Medium S-not-started Work has not started

Comments

@spoorn
Copy link

spoorn commented Aug 11, 2023

Happening on bevy = 0.11 and bevy_rapier3d = 0.22.0

When I load a GLTF Scene that has a scale transform that downscales the scene and spawn Colliders for its meshes, the Colliders don't match the scale until the 2nd frame.

It seems like the Colliders are always double the size of the scaled mesh, no matter what scale I set, so long as it's < 1.0. For example, I tried spawning a scene with scale 0.005, and the debug rendered colliders are double the mesh sizes (not the original 1.0 scale).

I was able to workaround the issue by simply running the system twice, and on the 2nd iteration, it auto fixes itself: https://github.com/spoorn/mangovillage/blob/3d/client/src/physics/mod.rs#L17

I thought maybe this was due to meshes taking a second to load, but I've tried putting time delays, tick delays (as in waiting 1000 frames before spawning the Colliders), checking if the assets are fully loaded, but the same problem always happens.

I have an MVP here: https://github.com/spoorn/mangovillage/blob/3d/mvp/src/main.rs if needed, clone the repo on branch 3d and run cargo run -p mvp.

Screenshot:

image

@Aceeri
Copy link
Contributor

Aceeri commented Aug 15, 2023

I'll take a look at this soon, thank you for the repro! 👍

@Vrixyz Vrixyz added D-Medium P-Medium S-not-started Work has not started A-Geometry A-Integration very bevy specific C-Bug Something isn't working labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Geometry A-Integration very bevy specific C-Bug Something isn't working D-Medium P-Medium S-not-started Work has not started
Projects
None yet
Development

No branches or pull requests

3 participants