Alright, I got pretty far on this last night before I had to go into work.
I’ve got two different systems in the works right now, when I hit a snag on one, I move on to the other.
The first, is an Editor subclass, which handles what I’m calling a LatheBrush. The LatheBrush is a 2-dimensional collection of points and edges.
The Lathebrush itself uses a custom Editor script to allow the user to click and drag on control points on the Lathe Brush.
I’m using the Handles class to draw lines between each vertice on the path, and then dots on the vertices in the 3d space, and a third pass draws dots at the midpoint of each edge. This works exactly like a standard 3d modeling tool.
I want to make it so that the player can click on these handles and drag them around in the editor, but I can’t find a class that allows me to detect mouse clicks on these handles. Can someone point out to me how this works? I activate edit mode by clicking on a button in the inspector, but any time I click on a handle, it’s going to lose focus on the object in the inspector by default. Is there some built-in behavior that I’m missing? Or am I going to have to create a special class to handle the selection, and movement of these handles within the Editor GUI?
As for the terrain system, I’m using something very similar. I’m creating terrain pages by clicking on one of four arrows that are drawn when you select either a face or an edge. When a vertex is selected, the only option is to collapse it into another vertex that it is connected to using similar arrows.
Interior faces are automatically deleted. Most of this is working, but again, the issue is the selection of faces, edges, and buttons… I’ve got everything drawing properly, but no dice on the buttons. I’d really like to draw filled shapes or textured 3D shapes in the world space, but I’m not sure of how to make it so that these shapes can be clicked on, since they are being drawn each frame…
I’m having some trouble envisioning how the built-in terrain painting system works. The best way I can think to do this, is to raycast to the mesh, and modify the vertex heights accordingly. (Of course, the my height calculation is going to be much more complex, involving the averaging the distance between each point and whatnot, but whatever.) How do the built in terrain shaders work, and how many different terrain textures can they support on one heightmap at a time?
Another question I had, was if it was possible to create a realtime 3D viewport in the inspector, or in an Editor Window? Kind of like the model viewer? Or is that a rendertexture? I’d like to manage some things via an external editor, seeing as a lot of my content is going to be databased content, and I’d like to be able to query, update, and drop items from the database, and view them in 3D while I do so.
I was also wondering about 3D Objects on the HUD. Would I have to pass data directly to GL to do that?
Thank you for the late answer, I was giving up on asking, and I got most of what I was wondering about done, by doing a combination of searching the forums, and using completely unrelated answers to stumble on the right ones, and reading and re-reading the reference material.