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

Implement click on vehicle to reverse direction #13

Open
torriem opened this issue Jan 19, 2024 · 4 comments
Open

Implement click on vehicle to reverse direction #13

torriem opened this issue Jan 19, 2024 · 4 comments

Comments

@torriem
Copy link
Owner

torriem commented Jan 19, 2024

Implement click on vehicle to reverse direction. Possibly can do it directly from QML using matrix4x4 transformations.

@Davidwedel
Copy link
Contributor

I guess we'll need to keep in mind that this needs to be anchored to the vehicle... If it's anchored to the center of the main screen, and the vehicle is moved off to the side, the click location and the vehicle will not line up. Same with the reverse arrow in #12

@torriem
Copy link
Owner Author

torriem commented Jan 19, 2024

I think I accidentally found the solution. The code the implements drag to pan calculates how far from the tractor the click is. So if we translate this to javascript, and then look for 0,0, that will be on the tractor. I'll create another issue to translate the click to field coordinates routines to javascript.

@torriem
Copy link
Owner Author

torriem commented Jan 20, 2024

Also the position of the reverse arrow can be calculated by replicating all the OpenGL coordinate transformations in Javascript. Fortunately qml provides a matrix4x4 type for this purpose.

I note that the current AOG code to draw the arrow does not take panning into account. It always puts it just left of the center of the screen (it does not use field coordinates or anything like that).

@Davidwedel
Copy link
Contributor

Both added to qml now.

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

No branches or pull requests

2 participants