Print at Mar 25, 2019 9:27:28 AM

Posted by skunk at Sep 12, 2017 9:04:30 PM
Re: Editing a group of vertices
Oh, right, this would be 2D only of course. SH3D is already built on a sort of 2.5D premise, so general 3D editing wouldn't even really work.

I saw in the source how walls and rooms are defined: walls being essentially a line segment + thickness, and rooms being a polygon. The general idea I'd like to propose is a temporary object that specifically exists to be able to refer to a subset of a (real) object's vertices.

To give a concrete example, let's say you have a simple square quartet of walls and a room as shown below:

N
0 *-----* 1 Wall N (0-1)
| | Wall E (1-2)
W | R | E Wall S (2-3)
| | Wall W (3-0)
3 *-----* 2 Room R (0-1-2-3)
S

You want to extend the east wall out a bit. So you would make a selection that ends up as follows:

  • Wall E
  • VertexSubset (vertex 1 of Wall N)
  • VertexSubset (vertex 2 of Wall S)
  • VertexSubset (vertices 1 and 2 of Room R)


(I'm playing fast and loose with how vertices are referenced here; of course each of these four vertices is not shared between objects. I'm also ignoring the existing mechanism that allows you to move Wall E while automatically updating Wall N and S, because as long as it doesn't also update Room R, it's an incomplete solution.)

Then when you move that selection, Wall E moves as usual, but each VertexSubset object passes on the adjustment to only the appropriate vertices of the referenced object. So the referenced objects "stretch" accordingly.

That's the basic idea. This wouldn't involve adding any new references/linkages to existing objects, just a new handle-object type by which to reference and manipulate parts of objects.

I have two main questions, then:

1) Would this approach work for you? You're much more familiar with the architecture than I am, to say the least, so maybe a better way is apparent?

2) I'll need to dive in deeper into the code to figure out all the MVC linkages and such. Any pointers? :) Just a hand-waved explanation of how you'd go about implementing this would be very helpful to an outsider...