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

Add synonyms for transform relative vectors #1663

Closed
alice-i-cecile opened this issue Mar 15, 2021 · 2 comments
Closed

Add synonyms for transform relative vectors #1663

alice-i-cecile opened this issue Mar 15, 2021 · 2 comments
Labels
C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@alice-i-cecile
Copy link
Member

alice-i-cecile commented Mar 15, 2021

What problem does this solve or what need does it fill?

Clearly communicates to users (and readers of code) how to point in various directions.

What solution would you like?

Add synonyms for local_x etc as left...

What alternative(s) have you considered?

Clearly document which direction the local_* directions point to. This is only a partial solution though, because the code is still much more challenging to read.

Additional context

Godot uses the same coordinate system and implements the constants linked here that we should borrow convention from.

Partial fix of #501.

Tried and failed in #1300 due to confusion; noticed in #1465 and corrected in #1476.

@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy C-Usability A targeted quality-of-life change that makes Bevy easier to use core labels Mar 15, 2021
@runfalk
Copy link

runfalk commented Mar 16, 2021

The thing is that these names only make sense if your camera is mounted on the Y-axis. I have a project where I mostly care about the XY position of things and have chosen a Z-oriented camera, so I lay out my entities in the XY plane. I found this image when looking for what other engines do, and it seems to be very split: https://www.techarthub.com/wp-content/uploads/coordinate-comparison-chart-full.jpg.

Do we want to force the decision of whether Y or Z is up?

@mockersf
Copy link
Member

Bevy is right-handed y-up

from https://discord.com/channels/691052431525675048/743663924229963868/793179969806270515:

You're welcome to keeping thinking about it / discussing. You will just have a hard time convincing me to change things. This is the decision making process I used:

  • 2d and 3d should be consistent for simplicity and to support 2.5d scenarios nicely
  • Y-up makes the most sense in 2d. "up" in 3d is way more divisive, so it matters less. Therefore Y should be up.
  • Right handed lends itself nicely to z-index expectations in 2d (increasing z indices go out of the screen / are more "in front")
  • Right handed aligns nicely with math users' expectations

@bors bors bot closed this as completed in b060e16 Apr 12, 2021
jihiggins pushed a commit to jihiggins/bevy that referenced this issue Apr 18, 2021
Fixes bevyengine#1663.

I think the directions are correct (same as [here](https://docs.godotengine.org/en/stable/classes/class_vector3.html?highlight=forward#constants)), but please double check because I might have mixed them up.

Co-authored-by: guimcaballero <guim.caballero@gmail.com>
Co-authored-by: Guim Caballero <guim.caballero@gmail.com>
ostwilkens pushed a commit to ostwilkens/bevy that referenced this issue Jul 27, 2021
Fixes bevyengine#1663.

I think the directions are correct (same as [here](https://docs.godotengine.org/en/stable/classes/class_vector3.html?highlight=forward#constants)), but please double check because I might have mixed them up.

Co-authored-by: guimcaballero <guim.caballero@gmail.com>
Co-authored-by: Guim Caballero <guim.caballero@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants