torriem / QtAgOpenGPS

A Qt C++ port of BrianT's AgOpenGPS
Other
38 stars 23 forks source link

Implement click on vehicle to reverse direction #13

Open torriem opened 8 months ago

torriem commented 8 months ago

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

Davidwedel commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 6 months ago

Both added to qml now.