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

Remove the Hand enum from XRHandTracker #91130

Merged

Conversation

Malcolmnixon
Copy link
Contributor

History

When initially introduced for Godot 4.3, the new XRHandTracker resource was written with a Hand enum [Left=0, Right=1] and a hand property describing the hand being tracked.

When the XR-Trackers were subsequently reorganized into an inheritance-tree, the XRHandTracker was modified to extend from XRPositionalTracker which already has a hand property [Unknown=0, Left=1, Right=2] relaying identical information.

At the time of the XR-Tracker refactoring, the decision was made to keep the XRHandTracker::Hand enum and getter/setter methods, but to drop the property as this was causing a direct name-collision.

Problem

What was missed was that for C#/.Net, properties are converted to PascalCase, and so the XRPositionalTracker hand property is renamed to Hand, causing a direct name collision with the XRHandTracker::Hand enum.

Change

This PR completely removes the XRHandTracker::Hand enum and getter/setter methods, as they are simply duplicate information for the existing XRPositionalTracker hand property.

The XRHandTracker type has not been released yet, and so cleaning it of duplicate/confusing accessors for the same information is preferred - and has the benefit of fixing the C#/.Net name collision.

Copy link
Contributor

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just need to fix the issue david found.

Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I accepted this reasoning when we discussed during the xr meeting.

@fire
Copy link
Member

fire commented Apr 25, 2024

Does anyone know why the unit tests are failing?

@dsnopek
Copy link
Contributor

dsnopek commented Apr 25, 2024

Does anyone know why the unit tests are failing?

It's unrelated. Re-basing on master will fix it. I had this on some other PRs I was working on as well.

@fire
Copy link
Member

fire commented Apr 25, 2024

No rush, but a reminder that the pull request is not able to be merged as is because of failing Github actions.

@Malcolmnixon Malcolmnixon force-pushed the xrhandtracker-dotnet-name-collision branch from 5688cbd to 67f2914 Compare April 25, 2024 23:27
…e hand property of the base class.

Co-Authored-By: David Snopek <[email protected]>
@Malcolmnixon Malcolmnixon force-pushed the xrhandtracker-dotnet-name-collision branch from 67f2914 to e00e5c0 Compare April 25, 2024 23:39
@Malcolmnixon
Copy link
Contributor Author

It's unrelated. Re-basing on master will fix it. I had this on some other PRs I was working on as well.

Rebasing solved the build issue.

@akien-mga akien-mga merged commit 0d589ab into godotengine:master Apr 26, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants