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

Update transforms after rework in bevy#374 #29

Merged
merged 2 commits into from
Sep 16, 2020

Conversation

guimcaballero
Copy link
Contributor

PR #374 changed how transforms work on bevy. This PR updates everything to be up to date.

Currently there's an issue I haven't been able to fix:

bevy

The cursor jumps around when on the ball, but not on the cube or the plane.

I'll try to fix it tomorrow, but if you see what I'm doing wrong please let me know.

@aevyrie
Copy link
Owner

aevyrie commented Sep 15, 2020

Thanks for the heads up, I wasn't aware of this upcoming change! That's an odd bug, I'll try and take a look at your code today.

@aevyrie
Copy link
Owner

aevyrie commented Sep 16, 2020

Found the issue. 😄

Because the translation and rotation updates were happening sequentially, It looks like the screen was occasionally refreshing between these updates, causing the debug cursor to fly off in space because the translation had update but not the rotation.

Changing the debug cursor update to this fixed the problem:

let transform_new = Mat4::from_rotation_translation(new_rotation, *position);
for mut transform in &mut query.iter() {
    *transform.value_mut() = transform_new;
}

Fixes "jumping cursor" bug
@aevyrie
Copy link
Owner

aevyrie commented Sep 16, 2020

Merging this ASAP because current version won't compile with the bevy update. Thanks @guimcaballero!

@aevyrie aevyrie merged commit ca17616 into aevyrie:master Sep 16, 2020
@guimcaballero
Copy link
Contributor Author

Oh wow, didn't expect that. Thanks for the help!

@guimcaballero guimcaballero deleted the update-to-bevy-master branch September 16, 2020 08:05
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

Successfully merging this pull request may close these issues.

2 participants