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

inverted sign wastes hours of girls life #338

Open
Cassumbra opened this issue Feb 28, 2024 · 3 comments
Open

inverted sign wastes hours of girls life #338

Cassumbra opened this issue Feb 28, 2024 · 3 comments
Labels
C-Examples Improvements or additions to examples question Further information is requested

Comments

@Cassumbra
Copy link

image
the -= there
WHY
wasted hours of my life after copying this code and trying to figure out why my first person character controller was all fucked up
this is my fault for writing code and just not really being fully mentally present, probably, but i just want to know why. why.
did you somehow place the camera in a weird position and the movement didnt look right so you inverted the sign? why.
please fix this. i dont know what you would have to do to fix this. if you put the camera on the opposite side i'm pretty sure it would fuck up the horizontal movement instead of the vertical movement??? so idk what you have to do to fix this or WHY its like this but please please please fix this

@Jondolf Jondolf added question Further information is requested C-Examples Improvements or additions to examples labels Feb 28, 2024
@Jondolf
Copy link
Owner

Jondolf commented Feb 28, 2024

Unfortunately, this isn't really something I can fix. The sign is negative there because of Bevy's right-handed Y-up coordinate system. In Bevy, +Z is "pointing towards the screen", while "forward" is -Z, which you can see from Transform::forward:

pub fn forward(&self) -> Direction3d {
    -self.local_z()
}

There's a lot of reasons why Bevy uses this coordinate system, and it's also consistent with e.g. Godot and a lot of other tools. Cart (the lead dev of Bevy) has some reasons listed here: bevyengine/bevy#10488

Here's also Freya's chart on coordinate systems: (copied from the discussion)

281936146-3f2d1284-95f8-4f90-a8c9-64c83be5bcb8

(Unreal sitting alone in the corner lol)

@Cassumbra
Copy link
Author

yeah, i cant really think of any sort of thing that would fix it, maybe the best thing to do would be to simply add a comment next to the code to point out the inverted sign?

@MiniaczQ
Copy link

Inverse left and right buttons...
The inversion has to happen, but it should happen in player local coordinate system, not world coordinate system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Examples Improvements or additions to examples question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants