TheDuckCow / godot-road-generator

A godot plugin for creating 3D highways and streets.
MIT License
401 stars 21 forks source link

Add, delete, and dissolve roadpoint buttons in 3D menu #64

Closed TheDuckCow closed 1 year ago

TheDuckCow commented 1 year ago

We want to try and emulate much of the 3D path's functionality, including a quick way to click to add points, as well as easily delete a point without much consequence.

It would be good to implement both of these at once, so that that join the menu at the same time.

Pulled out of this task to be on its own: https://github.com/TheDuckCow/godot-road-generator/issues/5

TheDuckCow commented 1 year ago

Initial priority is to focus on the low hanging fruit: the delete and dissolve buttons. Add RP will require some more RD (but well worth it).

Remember that we are operating in "modes", not buttons that directly perform an action. See curve behavior for reference:

Image

TheDuckCow commented 1 year ago

Moving this to unassigned and back into the backlog for now.

TheDuckCow commented 1 year ago

This video shows a unity asset with some useful controls it has for adding and extending road points. Noting down what I find interesting, but we'd synthesize what of this we would want to adopt and how to make it feel a bit more native to Godot.

TheDuckCow commented 1 year ago

On this page there's a likely useful function _forward_3d_draw_over_viewport which we could also use to draw or paint around the curser on or before clicks, perhaps to help indicate when and where connections are going to happen.

TheDuckCow commented 1 year ago

See also this demo which shows something very similar to likely what we might want, regarding the drawing of new roadpoints simultaneously with snapping and recognizing when to merge road points together to form a new intersection.

https://twitter.com/Nothke/status/1066506754794635264

In the context of adding road points and how this will fit together:

Forming an intersection will take some extra logic beyond this, but this is the initial idea of the interaction.

TheDuckCow commented 1 year ago

This task is now in progress, and I've basically completed the toolbar UI part. Works exactly and is styled exactly the same as the editor (in fact, no style overrides or custom icons used, I managed to get the source icons).

Screen Shot 2023-10-09 at 10 19 02 PM

I've introduced a mode value, but no functionality based off of it yet.

Next steps will be the actual functionality of these defined tickboxes.

TheDuckCow commented 1 year ago

With the latest commits, we have a functional-enough dissolve/delete command. So will be marking this as done shortly!