public sealed class WorkPlaneThe plane everything is placed, dragged and snapped in: an origin, a rotation and a step.
Remarks
Doc 24's D5, and it is CubeGrid's repositionable grid and Blender's 3D cursor in one object. The floor grid is a view of this rather than a thing of its own, which is what makes the three commonest blockout gestures possible at all: put the grid on a wall and everything afterwards is in the wall's plane; double and halve the step to build at four metres, then one, then a quarter; offset along the normal to build the second floor without doing arithmetic.
⚠ The rotation takes +Y onto the plane's normal, which is the same convention ScenePlacement.Upright uses. A plane is a floor whichever way it is facing — its local X and Z are the two directions you build along, and its local Y is out of it — so the ground plane is the identity and nothing about the default changes.
⚠ Step is nullable and null is not "one". Null means the grid picks its own spacing from how far away the camera is, which is what it has always done and what is right until somebody says otherwise. A number means the designer chose it — with ] and [ — and then the grid they can see and the grid they snap to are literally the same number, which is doc 24's D5's complaint about editors where they are two.
⚠ Doubling and halving from wherever it is, rather than a fixed ladder. Every level is then a sub-lattice of the last, so a 0.25 m object is still on the 4 m grid's lines. A step of a third would never be on one again, which is why the verb is a factor of two and not a text field.
Fields and properties (7)
public const float MinimumStepThe smallest step the halve verb will produce, in world units.
public const float MaximumStepAnd the largest, so the grid cannot be doubled out of the world.
public Vector3 OriginWhere the plane's own origin is, in world space.
public Quaternion RotationHow it is turned: the rotation taking +Y onto its normal.
public float? StepThe step the designer chose, or to let the grid choose.
public Vector3 NormalWhich way it faces, in world space.
public bool IsGroundWhether it is still the ground plane through the world origin.
Events (1)
public Action<WorkPlane>? ChangedRaised when anything about it changes.
Methods (11)
public void SetTo(Vector3 point, Vector3 normal)Puts the plane on a surface.
public void Offset(float distance)Moves the plane along its own normal.
public float Coarsen(float current)Doubles the step, from whatever it is now.
public float Refine(float current)Halves it.
public void Auto()Gives the spacing back to the camera.
public void Reset()Puts it back on the ground through the world origin, with an automatic step.
public float Effective(float current)The step in force, given what the grid would otherwise draw.
public Vector3 ToWorld(Vector3 local)Takes a point from the plane's own space into the world.
public Vector3 ToLocal(Vector3 world)And back.
public Vector3 Project(Vector3 world)The nearest point on the plane to a world point.
public Plane AsPlane()The plane itself, for a ray test.
Used by (13)
- BlockoutCreateVixen.Editor.Blockout
- BlockoutCreateTestsVixen.Editor.Blockout.Tests
- BlockoutCubeGridVixen.Editor.Blockout
- BlockoutModeVixen.Editor.Blockout
- BlockoutModuleVixen.Editor.Blockout
- EditorApplicationVixen.Editor.App
- SceneGridVixen.Editor.SceneView
- ScenePresenterVixen.Editor.App
- SceneViewportVixen.Editor.SceneView
- ShapeDragVixen.Editor.Blockout
- SnapContextVixen.Editor.SceneView
- WorkPlaneCommandTestsVixen.Editor.App.Tests
- WorkPlaneTestsVixen.Editor.SceneView.Tests