public static class BlockoutCubeGridDoc 24's cube-grid tool: boxes on the lattice, pushed a cell at a time.
Remarks
What Unreal's CubeGrid is for, and it is the fastest way to block out a building that anybody has found. A box on the grid, pushed and pulled by whole cells, at a step you double and halve as you go from the shape of the level to the shape of a room to the shape of a doorway. The step is WorkPlane.Step, so the grid you can see, the grid you snap to and the grid this counts in are one number — D5's complaint about editors where they are two or three.
⚠ It makes ordinary parametric boxes rather than a kind of its own. A cube-grid box is a Box whose size happens to be a whole number of cells and whose origin happens to be on a cell corner — so everything else in the toolset works on it unchanged, it inspects like any other shape, and a designer who wants one that is not on the grid any more just drags it. A shape kind of its own would have bought a badge in the inspector and cost every other verb a special case.
⚠ Corner mode is Corner and it is where the tool stops being parametric. Pulling one corner of a box down a cell is what makes a ramp, a wedge or a buttress out of a box, and it is not a box any more — so it demotes, exactly as any other edit to a face does. Doc 24 asks for corner mode by name and this is the honest shape of it: the cells stay the unit of movement, and what moves is geometry rather than a parameter.
⚠ What is not here is the hover preview. Unreal draws the candidate cell under the pointer before you commit to it, which is most of what makes the tool feel like a tool rather than like a dialog — and it is a drawing job on SceneLines' overlay rather than a modelling one. It is called out in docs/plan/24 as owed rather than quietly dropped.
Fields and properties (1)
public const float DefaultStepThe step the grid counts in when nothing has chosen one.
Methods (5)
public static Entity Create(SceneDocument document, GridBox box, WorkPlane? plane = null)Creates a box covering a region of the lattice, undoably.
public static bool TryRead(SceneDocument document, Entity entity, WorkPlane? plane, out GridBox box)Which cells a box entity covers, if it is still on the lattice.
public static bool Push(SceneDocument document, Entity entity, int axis, bool positive, int cells = 1, WorkPlane? plane = null)Pushes one side of a box entity out or in by whole cells, undoably.
public static bool Corner(MeshEdit editing, Vector3 offset, WorkPlane? plane = null)Moves the corners the selection covers by whole cells, undoably.
public static (int X, int Y, int Z) CellOf(Vector3 point, WorkPlane? plane = null)Which cell a world point is in.
Used by (2)
- BlockoutCreateTestsVixen.Editor.Blockout.Tests
- BlockoutModeVixen.Editor.Blockout