What GraphicsContext::RenderScene's record gets: the backend's recording state, as the struct of the ...
Definition gui_graphics_api.h:41
ViewportTransform DragGizmo(ViewportTool tool, GizmoPart part, const ViewportTransform &before, const ViewportCamera &camera, float2 size, float2 from, float2 to)
The selection a drag of part from from to to (view pixels) makes of before.
void PanCamera(ViewportCamera &camera, float2 delta, float heightPixels)
Slides the camera and its target so what was under the pointer follows a drag of delta pixels,...
bool ViewportProject(const ViewportCamera &camera, float2 size, float3 point, float2 &pixel)
Where point shows in the view, from its top left; false when it's behind the camera.
void OrbitCamera(ViewportCamera &camera, float2 delta)
Turns the camera round its target by a drag of delta pixels.
ViewportTool
What a drag on the view does to the selected object.
Definition gui_viewport_types.h:21
void FlyCamera(ViewportView &view, float seconds)
Moves the camera by the fly keys held (ViewportView::flyKeys) for seconds: forward,...
void AlignCamera(ViewportCamera &camera, int axis, bool fromNegative)
Looks along axis (0 x, 1 y, 2 z) toward its negative end, or its positive with fromBelow.
void FrameSelection(ViewportView &view)
Centers the selection, near enough to see all of it.
Ray ViewportRay(const ViewportCamera &camera, float2 pixel, float2 size)
The ray from the camera through pixel (from the view's top left) of a view size pixels.
GizmoPart
A part of the gizmo.
Definition gui_viewport_types.h:77
FlyKey
The fly keys' bits in ViewportView::flyKeys.
Definition gui_viewport_types.h:170
void CommitViewportEdit(ViewportView &view, const ViewportEdit &edit)
Applies edit and hands it to view.onEdit; does nothing for an empty one.
void ApplyViewportEdit(ViewportView &view, const ViewportEdit &edit, bool undo=false)
Does (or with undo, undoes) edit on the selection.
void LookCamera(ViewportCamera &camera, float2 delta)
Turns the camera where it stands (looks round) by a drag of delta pixels.
constexpr float kGizmoPixels
The gizmo's arrows, rings and handles are this many pixels long.
Definition gui_viewport_types.h:143
void DollyCamera(ViewportCamera &camera, float factor)
Moves the camera toward its target by factor (above 1: closer).
GizmoPart HitGizmo(const ViewportView &view, float2 pixel, float2 size)
The part of view's gizmo under pixel in a view size pixels, by its tool; None without a selection or ...
@ Move
Definition gui_viewport_types.h:23
@ Rotate
Definition gui_viewport_types.h:24
@ Z
an arrow, a ring or a scale handle
Definition gui_viewport_types.h:79
@ XZ
a plane square (move)
Definition gui_viewport_types.h:80
@ None
Definition gui_viewport_types.h:78
@ XY
Definition gui_viewport_types.h:80
@ YZ
Definition gui_viewport_types.h:80
@ FlyBack
Definition gui_viewport_types.h:170
@ FlyLeft
Definition gui_viewport_types.h:170
@ FlyForward
Definition gui_viewport_types.h:170
@ FlyRight
Definition gui_viewport_types.h:170
@ FlyDown
Definition gui_viewport_types.h:170
@ FlyUp
Definition gui_viewport_types.h:170
@ None
Definition gui_element_flags.h:18
@ X
Definition gui_scroll_management.h:24
@ Y
Definition gui_scroll_management.h:25
float4x4 TRS(float3 position, quat rotation, float3 scale)
Scale, then rotate, then move: an object's transform in the world.
Definition gui_math3d.h:93
float4x4 LookAt(float3 eye, float3 target, float3 up)
The view matrix of a camera at eye looking at target, up roughly up.
Definition gui_math3d.h:103
float3 Scale(float3 a, float3 b)
Definition gui_math3d.h:29
float3 Cross(float3 a, float3 b)
Definition gui_math3d.h:21
@ Center
Center on cross axis.
Definition gui_style.h:185
Definition gui_logging.h:24
One press that may become a drag, with what every control does around it: the focus and the capture o...
Definition gui_gesture.h:60
The part of a drawn control under the pointer (a key, a handle, a clip's end), for its hover look.
Definition gui_gesture.h:115
Definition gui_base_types.h:406
A ray: from origin, along direction (length 1).
Definition gui_math3d.h:145
A camera orbiting target, distance away.
Definition gui_viewport_types.h:30
float distance
Definition gui_viewport_types.h:32
float nearZ
Definition gui_viewport_types.h:37
float3 Position() const
Definition gui_viewport_types.h:41
float farZ
Definition gui_viewport_types.h:37
float3 Forward() const
The way it looks, length 1.
float4x4 View() const
Definition gui_viewport_types.h:44
float3 Up() const
Definition gui_viewport_types.h:43
float yaw
radians round y; 0 looks down -z, positive turns left
Definition gui_viewport_types.h:33
bool orthographic
Definition gui_viewport_types.h:36
float4x4 Projection(float aspect) const
For a view aspect wide over high.
float fovY
radians, top to bottom (50 degrees)
Definition gui_viewport_types.h:35
float3 target
Definition gui_viewport_types.h:31
float pitch
radians; negative looks down
Definition gui_viewport_types.h:34
float WorldPerPixel(float3 at, float heightPixels) const
How many world units a pixel is at at, in a view heightPixels high.
A gizmo's drag: the selection as it was and is.
Definition gui_viewport_types.h:70
ViewportTransform from
Definition gui_viewport_types.h:71
ViewportTransform to
Definition gui_viewport_types.h:71
bool empty() const
Definition gui_viewport_types.h:72
What the app's onRender gets each frame: the target's size and the camera's matrices,...
Definition gui_viewport_types.h:91
ScenePayload scene
Definition gui_viewport_types.h:95
uint2 size
pixels
Definition gui_viewport_types.h:92
float4x4 projection
Definition gui_viewport_types.h:94
float4x4 view
Definition gui_viewport_types.h:93
A viewport: what it shows and how. Keep it from frame to frame, as a CurveView.
Definition gui_viewport_types.h:100
ViewportTransform selection
Definition gui_viewport_types.h:108
bool hasSelection
The selected object, which the gizmo moves; none, no gizmo.
Definition gui_viewport_types.h:107
std::function< void(const ViewportRenderContext &)> onRender
Records the app's drawing into the view each frame (see ViewportRenderContext).
Definition gui_viewport_types.h:117
IntRect viewRect
the view last frame, in screen pixels
Definition gui_viewport_types.h:134
ViewportCamera camera
Definition gui_viewport_types.h:101
uint32_t revision
a gizmo part dragged; the selection as it began
Definition gui_viewport_types.h:135
color4f background
Behind what onRender draws; and all there is without it.
Definition gui_viewport_types.h:114
uint32_t revisionSeen
a gizmo part dragged; the selection as it began
Definition gui_viewport_types.h:135
Gesture< ViewportCamera > cameraDrag
the camera moved by a drag; as it was, for Escape
Definition gui_viewport_types.h:129
Gesture< ViewportTransform > gizmoDrag
a gizmo part dragged; the selection as it began
Definition gui_viewport_types.h:125
HoverPart< GizmoPart > hover
the part under the pointer
Definition gui_viewport_types.h:127
ViewportTool tool
Definition gui_viewport_types.h:102
bool showTools
The tools' buttons down the view's left.
Definition gui_viewport_types.h:105
float flySpeed
How fast W, A, S, D, Q and E move the camera while the right button looks round, in world units a sec...
Definition gui_viewport_types.h:112
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.
Definition gui_viewport_types.h:121
float2 dragFrom
the press, in view pixels
Definition gui_viewport_types.h:128
enum tachyon::ViewportView::CameraMove cameraMove
a gizmo part dragged; the selection as it began
uint8_t flyKeys
the fly keys held, by FlyKey bit
Definition gui_viewport_types.h:132
std::function< void(const ViewportEdit &)> onEdit
A gizmo's drag ended (already applied): put it in the undo history.
Definition gui_viewport_types.h:119
Gesture click
a left press off the gizmo: a pick if it doesn't move
Definition gui_viewport_types.h:131
CameraMove
a gizmo part dragged; the selection as it began
Definition gui_viewport_types.h:130
@ None
Definition gui_viewport_types.h:130
float selectionRadius
how big it is, for framing it (F)
Definition gui_viewport_types.h:109
bool flyFast
Shift held while flying.
Definition gui_viewport_types.h:133
GizmoPart activePart
the part dragged
Definition gui_viewport_types.h:126
Definition gui_base_types.h:394
Definition gui_base_types.h:120
Definition gui_base_types.h:149
Definition gui_base_types.h:258
A rotation, as a unit quaternion.
Definition gui_math3d.h:33
Definition gui_base_types.h:74