freezy / VisualPinball.Engine

:video_game: Visual Pinball Engine for Unity
https://docs.visualpinball.org
GNU General Public License v3.0
396 stars 62 forks source link

Fix drag points behavior in editor #455

Closed freezy closed 1 year ago

freezy commented 1 year ago

This PR changes how drag points are handled in the editor. This mainly applies to ramps, since they are the only drag-point enabled item where each drag point has an individual height (Z offset).

Before, when a ramp drag point was moved along the XY plane, it would stay on that plane and update the Z-offset accordingly. This is not how VPX behaves (it only updates the XY values and keeping the offset constant, moving it along the Z-curve of the ramp).

The VPX behavior makes more sense, because the Z-offset is typically only updated once the XY values are correct. In contrast, adding a new drag point would set the absolute height when later moving it in the XY plane, which is less desirable.

https://user-images.githubusercontent.com/70426/230793632-db520f07-7065-4f90-a014-7061771f0378.mp4

TODO: