public sealed class SceneViewportOne pane of the scene view: a camera, a gizmo, picking, and the control they live in.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
What joins the halves. Viewport says where and how big in render pixels and reports the input inside it, and deliberately knows nothing about rendering; RenderView is what a frame is drawn from and knows nothing about interfaces. This is where the one drives the other, and it is why neither of them had to.
Several of these at once is the point. A four-pane layout is four SceneViewports with their own cameras, their own view modes and their own render views — see ViewportLayout, and see ViewModes.ApplyTo for the one thing they must not share.
The navigation mapping is a method, not a table of bindings. Which button orbits is the sort of thing every user wants different, and the way to give them that is the shell's keymap over commands — not a second, parallel binding system inside the viewport. What is here is one documented default: right or middle drags the camera, left drives the gizmo, and Alt makes left orbit for people whose hands remember Maya.
⚠ Flight is the exception to that, and it has to be. WASDQE while the right button is held is a held gesture over six keys that already mean something else — W, E and R are the gizmo modes and A is frame-all — and a keymap of chords over commands can express neither half of that: it fires once on the press and it has no idea a mouse button is down. So the keys are read here, only while IsFlying, and consumed, so the shell's own bindings cannot fire underneath them. It stays one gesture rather than a binding system: FlyKeys is the whole of it, and it is settable.
Fields and properties (35)
public const float MaximumFlyStepThe longest frame flight will integrate, in seconds.
public Vector2 PointerPositionWhere the pointer last was, in document coordinates.
public Viewport ControlThe control the scene is drawn in.
public EditorCamera CameraWhere the camera is looking.
public TransformGizmo GizmoThe handles over the selection.
public SceneGrid GridThe floor grid.
public ViewModes ModesWhich way the scene is being drawn.
public SceneShow ShowWhat this pane draws.
public ViewportStats StatsWhat this pane cost last frame, for the readout in its corner.
public ScenePlacement PlacementWhere a drop would land.
public RenderView ViewThe view a frame is rendered from.
public const int BookmarkSlotsHow many numbered bookmark slots a pane has.
public IReadOnlyList<ViewBookmark?> BookmarksThe nine slots, empty where nothing has been saved.
public EditorDocument? DocumentWhere a gizmo drag is recorded.
public float WheelNotchHow far the wheel scrolls in one notch, in device-independent pixels.
public FlyBindings FlyKeysWhich keys fly the camera while the fly button is held.
public OrbitPivot OrbitAroundWhat an orbit swings around.
public bool ZoomToCursorWhether the wheel zooms at the pointer rather than at the middle of the pane.
public Vector3? OrbitAnchorWhere the selection is, for Selection.
public bool IsFlyingWhether the fly button is down, so that the fly keys are live.
public ISceneProbe? SurfacesWhat can answer "what is under this ray", for placement and for snapping.
public PickingBuffer? PickingWhere the answers to picks are collected, once a device exists.
public IScenePicker? PickerWhat answers "which entity is under this ray" when there is no device to ask.
public SceneMeasure MeasureThe tape measure: click two points and read the distance, three and read the angle.
public ReferenceVolumeSet ReferencesThe scale references drawn in this pane, if any.
public NumericEntry TypingThe exact transform being typed, if one is.
public ISubObjectPicker? SubObjectsWhat answers "which face of this mesh", or for nothing.
public MeshEdit? EditingWhich mesh this pane is editing the elements of, or for none.
public ComponentGizmos? GizmosThe contributed per-component gizmos, or for none.
public IViewportInput? InputWhat gets first refusal on this pane's input, or for none.
public IEditorRegistry ExtensionsWhere the pane looks for contributed tools.
public IReadOnlyList<SceneTool> ToolsEvery contributed tool, in the order they should be offered.
public SceneTool? ActiveToolWhat the pane is doing inside its mode, or for nothing.
public Marquee? SelectingThe rubber-band being dragged, or .
public Func<IReadOnlyList<IGizmoTarget>>? TargetsFactoryTurns the shared selection into things the gizmo can move.
Events (3)
public Action<SceneViewport>? TransformedRaised after a gizmo drag has been recorded.
public Action<SceneViewport, PickRequest>? PickRequestedRaised when the pane asks for what is under a point. The host answers it.
public Action<SceneViewport, IReadOnlyList<Entity>, bool>? BandedRaised when a band has taken a set of entities. The host owns the selection.
Methods (33)
public SceneTool? FindTool(string id)The contributed tool with an id, or if nothing contributed one.
public SceneViewport(Viewport control, Selection<Entity> selection, string name = "SceneView")Puts a scene into a viewport control.
public void Update(TimeSpan delta)Advances the pane by a frame: flight, then the render view.
public void Fly(TimeSpan delta)Moves the camera by whatever fly keys are held.
public bool Pick(Vector2 point, bool additive = false)Asks what is under a point, in render pixels.
public SubObject PickSubObject(Entity entity, Vector2 point, SubObjectFilter filter = All, float tolerance = 10)Asks which face, edge or vertex of an entity is under a point, in render pixels.
public bool PickElement(Vector2 point, bool additive = false)Selects the element under a point, in whatever element mode the pane is in.
public SubObject HoverElement(Vector2 point)Works out which element the pointer is over, and remembers it.
public void Resolve(PickResult result, Func<uint, Entity> resolve)Turns a pick that has come back into a selection change.
public void Select(Entity entity, bool additive)Puts an entity in the selection, or clears it.
public void BeginSelect(Vector2 point, bool additive)Starts a rubber-band at a point.
public void DragSelect(Vector2 point)Drags the band's free corner.
public bool EndSelect()Ends a band and selects what it took.
public bool CancelSelect()Abandons a band without selecting anything.
public void FocusSelection(BoundingBox? bounds)Points the camera at what is selected.
public ViewBookmark? SaveBookmark(int slot)Saves where the camera is into one of the nine slots.
public bool RestoreBookmark(int slot)Goes back to a saved view.
public bool HasBookmark(int slot)Whether a slot has a view in it.
public static NavigationAction Interpret(PointerButton button, ModifierKeys modifiers)What a drag with this button and these modifiers means.
public static float Notches(float delta, float pixelsPerNotch)What a wheel event is worth to the camera.
public void Wheel(float delta)Zooms by one wheel event's worth of scrolling.
public void Wheel(float delta, Vector2 point)Zooms by one wheel event's worth of scrolling, at a point in the pane.
public void Orbit(float deltaX, float deltaY)Turns the camera, honouring OrbitAround.
public static bool Flies(PointerButton button)Whether holding this button also flies the camera.
public GizmoHandle Hover(Vector2 point)Records which handle the pointer is over, so the viewport can highlight it.
public Placement Drop(Vector2 point)Where something dropped at a point in this pane would land.
public bool BeginManipulate(Vector2 point)Starts a gizmo drag if a handle is under the point.
public bool EndManipulate()Ends a gizmo drag and records it.
public Ray Ray(Vector2 point)The ray under a point in this pane.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public bool RefreshTargets()Rebuilds what the gizmo is holding, now rather than on the next frame.
public Ray PointerRay()The ray under wherever the pointer last was.
public Vector3 PointerOnPlane()Where the pointer meets the work plane, for something being placed there.
Used by (43, showing 40)
- AttachedVixen.Editor.App
- BlockoutModeVixen.Editor.Blockout
- CameraTestsVixen.Editor.SceneView.Tests
- ComponentGizmoTestsVixen.Editor.SceneView.Tests
- DeclaredContributionsVixen.Editor.App
- EditorAffordanceTestsVixen.Editor.App.Tests
- EditorApplicationVixen.Editor.App
- EditorHostVixen.Editor.Host
- EditorModeTestsVixen.Editor.App.Tests
- EditorSessionVixen.Editor.Testing
- FlightTestsVixen.Editor.SceneView.Tests
- FoliageModeVixen.Editor.Terrain
- IViewportInputVixen.Editor.SceneView
- ManipulationTestsVixen.Editor.SceneView.Tests
- MarqueeOverlayVixen.Editor.SceneView
- MarqueeTestsVixen.Editor.SceneView.Tests
- ModeInputVixen.Editor.App
- NavigationTestsVixen.Editor.SceneView.Tests
- OneEditPathTestsVixen.Editor.App.Tests
- OutOfTreePluginTestsVixen.Editor.App.Tests
- OwnerVixen.Editor.SceneView.Tests
- PaneVixen.Editor.SceneView.Tests
- PickingTestsVixen.Editor.SceneView.Tests
- PrecisionTestsVixen.Editor.SceneView.Tests
- ProxyShapeEditorTestsVixen.Editor.AssetEditors.Tests
- ProxyShapeViewVixen.Editor.AssetEditors
- SceneLinesVixen.Editor.SceneView
- SceneMaterialTestsVixen.Editor.SceneView.Tests
- SceneMenuTestsVixen.Editor.App.Tests
- SceneMeshesVixen.Editor.SceneView
- SceneOverlayVixen.Editor.SceneView
- ScenePresenterVixen.Editor.App
- SnapCommandTestsVixen.Editor.App.Tests
- SnapContextTestsVixen.Editor.SceneView.Tests
- SnapTestsVixen.Editor.SceneView.Tests
- TerrainModeVixen.Editor.Terrain
- ViewportChromeVixen.Editor.App
- ViewportIdsVixen.Editor.App
- ViewportInputTestsVixen.Editor.SceneView.Tests
- ViewportLayoutVixen.Editor.SceneView