Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

[BUG] position_from_screen function missing. #1725

Closed
distransient opened this issue Jun 16, 2019 · 0 comments · Fixed by #1733
Closed

[BUG] position_from_screen function missing. #1725

distransient opened this issue Jun 16, 2019 · 0 comments · Fixed by #1733
Assignees
Labels
diff: easy Achievable by a single junior developer with a bit of guidance. good first issue This is a good issue to start with if you are new and want to contribute to Amethyst. pri: normal An issue that is causing a noticeable impact, but can be worked around team: engine type: bug Something is not working as it should.
Projects
Milestone

Comments

@distransient
Copy link
Member

Description

This was added in #1442 but I believe it was missed when either rendy or transform refactors were merged. It's currently mentioned in the changelog/release for 0.11 although it isn't currently in the code.

@distransient distransient added type: bug Something is not working as it should. status: needs triage diff: easy Achievable by a single junior developer with a bit of guidance. good first issue This is a good issue to start with if you are new and want to contribute to Amethyst. pri: normal An issue that is causing a noticeable impact, but can be worked around team: engine and removed status: needs triage labels Jun 16, 2019
@jaynus jaynus self-assigned this Jun 16, 2019
@distransient distransient added this to Needs triage in Bugs Jun 18, 2019
@distransient distransient moved this from Needs triage to Normal Priority in Bugs Jun 18, 2019
jaynus added a commit to jaynus/amethyst that referenced this issue Jun 18, 2019
jaynus added a commit to jaynus/amethyst that referenced this issue Jun 18, 2019
@jaynus jaynus added this to the 0.12 milestone Jun 18, 2019
bors bot added a commit that referenced this issue Jun 26, 2019
1733: Add screen_to_world & world_to_screen to amethyst_rendy::Camera r=jaynus a=jaynus

Fixes #1725

## Description

As described in #1725, During the rendy refactor position_from_screen got neglected during the feature parity port. This adds it back renamed as 'world_to_screen'.  This also adds appropriate unit tests for these functions that didn't exist at all. 

These tests require setting the global_matrix of Transform in a test, which isn't currently available from other crates. So, I added a cfg(debug_assertions)  function to Transform to allow that to happen. @Jojolepro  thoughts on this?

## Additions
- amethyst_rendy::Camera::screen_to_world - Translates a Point2 from screen space to world space
- amethyst_rendy::Camera::world_to_screen  - Translates a Point3 from world space to screen space

## PR Checklist

By placing an x in the boxes I certify that I have:

- [x] Ran `cargo test --all` locally if this modified any rs files.
- [x] Ran `cargo +stable fmt --all` locally if this modified any rs files.
- [x] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment.
- [x] Added unit tests for new APIs if any were added in this PR.
- [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme.


Co-authored-by: Walter Pearce <jaynus@gmail.com>
Co-authored-by: Fletcher Haynes <fletcher@capitalprawn.com>
Co-authored-by: jaynus <jaynus@gmail.com>
bors bot added a commit that referenced this issue Jun 26, 2019
1733: Add screen_to_world & world_to_screen to amethyst_rendy::Camera r=jaynus a=jaynus

Fixes #1725

## Description

As described in #1725, During the rendy refactor position_from_screen got neglected during the feature parity port. This adds it back renamed as 'world_to_screen'.  This also adds appropriate unit tests for these functions that didn't exist at all. 

These tests require setting the global_matrix of Transform in a test, which isn't currently available from other crates. So, I added a cfg(debug_assertions)  function to Transform to allow that to happen. @Jojolepro  thoughts on this?

## Additions
- amethyst_rendy::Camera::screen_to_world - Translates a Point2 from screen space to world space
- amethyst_rendy::Camera::world_to_screen  - Translates a Point3 from world space to screen space

## PR Checklist

By placing an x in the boxes I certify that I have:

- [x] Ran `cargo test --all` locally if this modified any rs files.
- [x] Ran `cargo +stable fmt --all` locally if this modified any rs files.
- [x] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment.
- [x] Added unit tests for new APIs if any were added in this PR.
- [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme.


Co-authored-by: Walter Pearce <jaynus@gmail.com>
Co-authored-by: Fletcher Haynes <fletcher@capitalprawn.com>
Co-authored-by: jaynus <jaynus@gmail.com>
@bors bors bot closed this as completed in #1733 Jun 26, 2019
Bugs automation moved this from Normal Priority to Closed Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
diff: easy Achievable by a single junior developer with a bit of guidance. good first issue This is a good issue to start with if you are new and want to contribute to Amethyst. pri: normal An issue that is causing a noticeable impact, but can be worked around team: engine type: bug Something is not working as it should.
Projects
No open projects
Bugs
  
Closed
Development

Successfully merging a pull request may close this issue.

2 participants