TachyonUI 1.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::ViewportView Struct Reference

A viewport: what it shows and how. Keep it from frame to frame, as a CurveView. More...

#include <gui_controls/gui_viewport_types.h>

Public Attributes

ViewportCamera camera
ViewportTool tool = ViewportTool::Move
bool showTools = true
 The tools' buttons down the view's left.
bool hasSelection = false
 The selected object, which the gizmo moves; none, no gizmo.
ViewportTransform selection
float selectionRadius = 1.0f
 how big it is, for framing it (F)
float flySpeed = 4.0f
 How fast W, A, S, D, Q and E move the camera while the right button looks round, in world units a second; the wheel changes it then, and Shift triples it.
color4f background { 0.07f, 0.08f, 0.09f, 1.0f }
 Behind what onRender draws; and all there is without it.
std::function< void(const ViewportRenderContext &)> onRender
 Records the app's drawing into the view each frame (see ViewportRenderContext).
std::function< void(const ViewportEdit &)> onEdit
 A gizmo's drag ended (already applied): put it in the undo history.
std::function< void(const Ray &ray, KeyModifier modifiers)> onClick
 A click that didn't drag, off the gizmo: the ray through it, to pick with.

Internal: kept between frames while the user works

enum class  CameraMove : uint8_t {
  None , Pan , Orbit , Look ,
  Dolly
}
 a gizmo part dragged; the selection as it began More...
Gesture< ViewportTransform > gizmoDrag
 a gizmo part dragged; the selection as it began
GizmoPart activePart = GizmoPart::None
 the part dragged
HoverPart< GizmoPart > hover
 the part under the pointer
float2 dragFrom {}
 the press, in view pixels
Gesture< ViewportCamera > cameraDrag
 the camera moved by a drag; as it was, for Escape
enum tachyon::ViewportView::CameraMove cameraMove = CameraMove::None
 a gizmo part dragged; the selection as it began
Gesture click
 a left press off the gizmo: a pick if it doesn't move
uint8_t flyKeys = 0
 the fly keys held, by FlyKey bit
bool flyFast = false
 Shift held while flying.
IntRect viewRect {}
 the view last frame, in screen pixels
uint32_t revision = 0
 a gizmo part dragged; the selection as it began
uint32_t revisionSeen = 0
 a gizmo part dragged; the selection as it began

Detailed Description

A viewport: what it shows and how. Keep it from frame to frame, as a CurveView.

Member Enumeration Documentation

◆ CameraMove

enum class tachyon::ViewportView::CameraMove : uint8_t
strong

a gizmo part dragged; the selection as it began

Enumerator
None 
Pan 
Orbit 
Look 
Dolly 

Member Data Documentation

◆ camera

ViewportCamera tachyon::ViewportView::camera

◆ tool

ViewportTool tachyon::ViewportView::tool = ViewportTool::Move

◆ showTools

bool tachyon::ViewportView::showTools = true

The tools' buttons down the view's left.

Off for an app with a toolbar of its own that sets tool (Q, W, E and R still do).

◆ hasSelection

bool tachyon::ViewportView::hasSelection = false

The selected object, which the gizmo moves; none, no gizmo.

◆ selection

ViewportTransform tachyon::ViewportView::selection

◆ selectionRadius

float tachyon::ViewportView::selectionRadius = 1.0f

how big it is, for framing it (F)

◆ flySpeed

float tachyon::ViewportView::flySpeed = 4.0f

How fast W, A, S, D, Q and E move the camera while the right button looks round, in world units a second; the wheel changes it then, and Shift triples it.

◆ background

color4f tachyon::ViewportView::background { 0.07f, 0.08f, 0.09f, 1.0f }

Behind what onRender draws; and all there is without it.

◆ onRender

std::function<void(const ViewportRenderContext&)> tachyon::ViewportView::onRender

Records the app's drawing into the view each frame (see ViewportRenderContext).

◆ onEdit

std::function<void(const ViewportEdit&)> tachyon::ViewportView::onEdit

A gizmo's drag ended (already applied): put it in the undo history.

◆ onClick

std::function<void(const Ray& ray, KeyModifier modifiers)> tachyon::ViewportView::onClick

A click that didn't drag, off the gizmo: the ray through it, to pick with.

◆ gizmoDrag

Gesture<ViewportTransform> tachyon::ViewportView::gizmoDrag

a gizmo part dragged; the selection as it began

◆ activePart

GizmoPart tachyon::ViewportView::activePart = GizmoPart::None

the part dragged

◆ hover

HoverPart<GizmoPart> tachyon::ViewportView::hover

the part under the pointer

◆ dragFrom

float2 tachyon::ViewportView::dragFrom {}

the press, in view pixels

◆ cameraDrag

Gesture<ViewportCamera> tachyon::ViewportView::cameraDrag

the camera moved by a drag; as it was, for Escape

◆ cameraMove

enum tachyon::ViewportView::CameraMove tachyon::ViewportView::cameraMove = CameraMove::None

a gizmo part dragged; the selection as it began

◆ click

Gesture tachyon::ViewportView::click

a left press off the gizmo: a pick if it doesn't move

◆ flyKeys

uint8_t tachyon::ViewportView::flyKeys = 0

the fly keys held, by FlyKey bit

◆ flyFast

bool tachyon::ViewportView::flyFast = false

Shift held while flying.

◆ viewRect

IntRect tachyon::ViewportView::viewRect {}

the view last frame, in screen pixels

◆ revision

uint32_t tachyon::ViewportView::revision = 0

a gizmo part dragged; the selection as it began

◆ revisionSeen

uint32_t tachyon::ViewportView::revisionSeen = 0

a gizmo part dragged; the selection as it began


The documentation for this struct was generated from the following file: