Low-Level Controllers API¶
Low-level camera, panzoom, arcball, fly, and turntable controller records.
Status: advanced/unstable
This generated page lists exported C functions and their canonical public types
classified by the v0.4 C API reference policy. Raw Python ctypes call forms are
documented separately.
Use these advanced records for integrations below the retained scene controller API.
Common workflows:
Functions: 100 Types: 24
Symbol Groups¶
| Group | Functions | Types | Headers |
|---|---|---|---|
| Arcball | 22 | 4 | include/datoviz/controller/arcball.h |
| Camera | 14 | 7 | include/datoviz/controller/camera.h, include/datoviz/controller/panzoom.h |
| Fly | 29 | 4 | include/datoviz/controller/fly.h |
| Panzoom | 20 | 6 | include/datoviz/controller/panzoom.h |
| Turntable | 15 | 3 | include/datoviz/controller/turntable.h |
Grouped function index
Arcball
| Function | Header |
|---|---|
dvz_arcball_angles() |
include/datoviz/controller/arcball.h |
dvz_arcball_connect() |
include/datoviz/controller/arcball.h |
dvz_arcball_constrain() |
include/datoviz/controller/arcball.h |
dvz_arcball_create() |
include/datoviz/controller/arcball.h |
dvz_arcball_desc() |
include/datoviz/controller/arcball.h |
dvz_arcball_destroy() |
include/datoviz/controller/arcball.h |
dvz_arcball_disconnect() |
include/datoviz/controller/arcball.h |
dvz_arcball_end() |
include/datoviz/controller/arcball.h |
dvz_arcball_initial() |
include/datoviz/controller/arcball.h |
dvz_arcball_is_interacting() |
include/datoviz/controller/arcball.h |
dvz_arcball_model() |
include/datoviz/controller/arcball.h |
dvz_arcball_mvp() |
include/datoviz/controller/arcball.h |
dvz_arcball_pan() |
include/datoviz/controller/arcball.h |
dvz_arcball_pan_shift() |
include/datoviz/controller/arcball.h |
dvz_arcball_pointer() |
include/datoviz/controller/arcball.h |
dvz_arcball_reset() |
include/datoviz/controller/arcball.h |
dvz_arcball_resize() |
include/datoviz/controller/arcball.h |
dvz_arcball_rotate() |
include/datoviz/controller/arcball.h |
dvz_arcball_rotate_axis() |
include/datoviz/controller/arcball.h |
dvz_arcball_set() |
include/datoviz/controller/arcball.h |
dvz_arcball_state() |
include/datoviz/controller/arcball.h |
dvz_arcball_zoom() |
include/datoviz/controller/arcball.h |
Camera
| Function | Header |
|---|---|
dvz_camera_create() |
include/datoviz/controller/camera.h |
dvz_camera_desc() |
include/datoviz/controller/camera.h |
dvz_camera_destroy() |
include/datoviz/controller/camera.h |
dvz_camera_get_orthographic_bounds() |
include/datoviz/controller/camera.h |
dvz_camera_get_projection() |
include/datoviz/controller/camera.h |
dvz_camera_get_view() |
include/datoviz/controller/camera.h |
dvz_camera_mvp() |
include/datoviz/controller/camera.h |
dvz_camera_projection() |
include/datoviz/controller/camera.h |
dvz_camera_resize() |
include/datoviz/controller/camera.h |
dvz_camera_set_orthographic() |
include/datoviz/controller/camera.h |
dvz_camera_set_orthographic_bounds() |
include/datoviz/controller/camera.h |
dvz_camera_set_perspective() |
include/datoviz/controller/camera.h |
dvz_camera_set_view() |
include/datoviz/controller/camera.h |
dvz_camera_view() |
include/datoviz/controller/camera.h |
Fly
| Function | Header |
|---|---|
dvz_fly_apply_camera() |
include/datoviz/controller/fly.h |
dvz_fly_clear_pivot() |
include/datoviz/controller/fly.h |
dvz_fly_connect() |
include/datoviz/controller/fly.h |
dvz_fly_create() |
include/datoviz/controller/fly.h |
dvz_fly_desc() |
include/datoviz/controller/fly.h |
dvz_fly_destroy() |
include/datoviz/controller/fly.h |
dvz_fly_disconnect() |
include/datoviz/controller/fly.h |
dvz_fly_get_position() |
include/datoviz/controller/fly.h |
dvz_fly_get_target() |
include/datoviz/controller/fly.h |
dvz_fly_get_up() |
include/datoviz/controller/fly.h |
dvz_fly_has_pivot() |
include/datoviz/controller/fly.h |
dvz_fly_initial() |
include/datoviz/controller/fly.h |
dvz_fly_initial_lookat() |
include/datoviz/controller/fly.h |
dvz_fly_keyboard() |
include/datoviz/controller/fly.h |
dvz_fly_look_at_pivot() |
include/datoviz/controller/fly.h |
dvz_fly_move_forward() |
include/datoviz/controller/fly.h |
dvz_fly_move_right() |
include/datoviz/controller/fly.h |
dvz_fly_move_up() |
include/datoviz/controller/fly.h |
dvz_fly_orbit() |
include/datoviz/controller/fly.h |
dvz_fly_pivot() |
include/datoviz/controller/fly.h |
dvz_fly_pointer() |
include/datoviz/controller/fly.h |
dvz_fly_reset() |
include/datoviz/controller/fly.h |
dvz_fly_resize() |
include/datoviz/controller/fly.h |
dvz_fly_roll() |
include/datoviz/controller/fly.h |
dvz_fly_rotate() |
include/datoviz/controller/fly.h |
dvz_fly_set_camera() |
include/datoviz/controller/fly.h |
dvz_fly_set_mode() |
include/datoviz/controller/fly.h |
dvz_fly_update() |
include/datoviz/controller/fly.h |
dvz_fly_viewport() |
include/datoviz/controller/fly.h |
Panzoom
| Function | Header |
|---|---|
dvz_panzoom_connect() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_create() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_desc() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_destroy() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_disconnect() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_end() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_extent() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_mvp() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_pan() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_pan_shift() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_pointer() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_reset() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_resize() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_resolve() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_state() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_viewport() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_zoom() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_zoom_limits() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_zoom_shift() |
include/datoviz/controller/panzoom.h |
dvz_panzoom_zoom_wheel() |
include/datoviz/controller/panzoom.h |
Turntable
| Function | Header |
|---|---|
dvz_turntable_apply_camera() |
include/datoviz/controller/turntable.h |
dvz_turntable_connect() |
include/datoviz/controller/turntable.h |
dvz_turntable_create() |
include/datoviz/controller/turntable.h |
dvz_turntable_desc() |
include/datoviz/controller/turntable.h |
dvz_turntable_destroy() |
include/datoviz/controller/turntable.h |
dvz_turntable_disconnect() |
include/datoviz/controller/turntable.h |
dvz_turntable_dolly() |
include/datoviz/controller/turntable.h |
dvz_turntable_orbit() |
include/datoviz/controller/turntable.h |
dvz_turntable_pan() |
include/datoviz/controller/turntable.h |
dvz_turntable_pivot() |
include/datoviz/controller/turntable.h |
dvz_turntable_pointer() |
include/datoviz/controller/turntable.h |
dvz_turntable_reset() |
include/datoviz/controller/turntable.h |
dvz_turntable_resize() |
include/datoviz/controller/turntable.h |
dvz_turntable_set_camera() |
include/datoviz/controller/turntable.h |
dvz_turntable_viewport() |
include/datoviz/controller/turntable.h |
Arcball¶
Functions
dvz_arcball_angles()¶
Read current Euler angles.
void dvz_arcball_angles(
DvzArcball * arcball,
vec3 out_angles
);
| Field | Type | Description |
|---|---|---|
arcball |
DvzArcball * |
the arcball controller; must not be NULL |
out_angles |
vec3 |
output Euler angles in radians |
Declared in include/datoviz/controller/arcball.h:225.
dvz_arcball_connect()¶
Subscribe the arcball to an input router.
DvzResult dvz_arcball_connect(
DvzArcball * arcball,
DvzInputRouter * router
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
router |
DvzInputRouter * |
input router |
Declared in include/datoviz/controller/arcball.h:305.
dvz_arcball_constrain()¶
Set a rotation constraint axis.
DvzResult dvz_arcball_constrain(
DvzArcball * arcball,
vec3 axis
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
axis |
vec3 |
rotation constraint axis |
Declared in include/datoviz/controller/arcball.h:215.
dvz_arcball_create()¶
Create a standalone arcball controller.
DvzArcball * dvz_arcball_create(
const DvzArcballDesc * desc
);
| Field | Type | Description |
|---|---|---|
| return | DvzArcball * |
the controller, or NULL on allocation failure |
desc |
const DvzArcballDesc * |
arcball descriptor, or NULL for defaults |
Related: dvz_arcball_destroy().
Declared in include/datoviz/controller/arcball.h:109.
dvz_arcball_desc()¶
Return the default standalone arcball descriptor.
The default viewport is 800 by 600 pixels and no controller flags are enabled.
DvzArcballDesc dvz_arcball_desc(void);
| Field | Type | Description |
|---|---|---|
| return | DvzArcballDesc |
a fully initialized descriptor that callers may modify |
Declared in include/datoviz/controller/arcball.h:99.
dvz_arcball_destroy()¶
Destroy a standalone arcball controller.
The controller must have been unsubscribed from any input router before this call.
void dvz_arcball_destroy(
DvzArcball * arcball
);
| Field | Type | Description |
|---|---|---|
arcball |
DvzArcball * |
the owned arcball controller to destroy; must not be NULL |
Related: dvz_arcball_create().
Declared in include/datoviz/controller/arcball.h:327.
dvz_arcball_disconnect()¶
Unsubscribe the arcball from a router.
DvzResult dvz_arcball_disconnect(
DvzArcball * arcball,
DvzInputRouter * router
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
router |
DvzInputRouter * |
input router |
Declared in include/datoviz/controller/arcball.h:316.
dvz_arcball_end()¶
Commit the in-flight rotation into the accumulated matrix (call at drag stop).
DvzResult dvz_arcball_end(
DvzArcball * arcball
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
Declared in include/datoviz/controller/arcball.h:260.
dvz_arcball_initial()¶
Set the initial Euler angles and reset.
DvzResult dvz_arcball_initial(
DvzArcball * arcball,
vec3 angles
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
angles |
vec3 |
initial Euler angles |
Declared in include/datoviz/controller/arcball.h:120.
dvz_arcball_is_interacting()¶
Return whether the pointer is currently interacting with the arcball.
_Bool dvz_arcball_is_interacting(
DvzArcball * arcball
);
| Field | Type | Description |
|---|---|---|
| return | _Bool |
true while a valid controller is handling a press or drag, otherwise false |
arcball |
DvzArcball * |
the arcball controller, or NULL |
Declared in include/datoviz/controller/arcball.h:281.
dvz_arcball_model()¶
Compute the model matrix (accumulated × in-flight rotation).
Arcball pan and zoom are camera view state and are not included here.
DvzResult dvz_arcball_model(
DvzArcball * arcball,
mat4 model
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
model |
mat4 |
output model matrix |
Declared in include/datoviz/controller/arcball.h:250.
dvz_arcball_mvp()¶
Fill the MVP struct from the current arcball state.
Rotation is applied to the model matrix; pan and zoom are applied to view.
void dvz_arcball_mvp(
DvzArcball * arcball,
DvzMVP * mvp
);
| Field | Type | Description |
|---|---|---|
arcball |
DvzArcball * |
the arcball controller; must not be NULL |
mvp |
DvzMVP * |
output MVP state; must not be NULL |
Declared in include/datoviz/controller/arcball.h:272.
dvz_arcball_pan()¶
Set the camera view-plane pan offset.
DvzResult dvz_arcball_pan(
DvzArcball * arcball,
vec2 pan
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
pan |
vec2 |
panel-plane pan offset |
Declared in include/datoviz/controller/arcball.h:172.
dvz_arcball_pan_shift()¶
Apply an incremental panel-plane pan shift in pixels.
DvzResult dvz_arcball_pan_shift(
DvzArcball * arcball,
vec2 shift_px
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
shift_px |
vec2 |
shift in viewport pixels |
Declared in include/datoviz/controller/arcball.h:192.
dvz_arcball_pointer()¶
Process a pointer event and update arcball state.
The event is borrowed for the duration of the call.
_Bool dvz_arcball_pointer(
DvzArcball * arcball,
const DvzPointerEvent * ev
);
| Field | Type | Description |
|---|---|---|
| return | _Bool |
true if the event was consumed |
arcball |
DvzArcball * |
the arcball controller; must not be NULL |
ev |
const DvzPointerEvent * |
the pointer event to process; must not be NULL |
Declared in include/datoviz/controller/arcball.h:294.
dvz_arcball_reset()¶
Reset to the initial orientation.
DvzResult dvz_arcball_reset(
DvzArcball * arcball
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
Declared in include/datoviz/controller/arcball.h:130.
dvz_arcball_resize()¶
Update the viewport size (call on window resize).
DvzResult dvz_arcball_resize(
DvzArcball * arcball,
float width,
float height
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
width |
float |
viewport width in pixels |
height |
float |
viewport height in pixels |
Declared in include/datoviz/controller/arcball.h:204.
dvz_arcball_rotate()¶
Apply an in-flight rotation from two NDC screen positions.
DvzResult dvz_arcball_rotate(
DvzArcball * arcball,
vec2 cur_pos,
vec2 last_pos
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
cur_pos |
vec2 |
current pointer position in normalized device coordinates |
last_pos |
vec2 |
previous pointer position in normalized device coordinates |
Declared in include/datoviz/controller/arcball.h:237.
dvz_arcball_rotate_axis()¶
Apply an incremental rotation around an axis to the accumulated orientation.
DvzResult dvz_arcball_rotate_axis(
DvzArcball * arcball,
float angle,
vec3 axis
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
angle |
float |
rotation angle in radians |
axis |
vec3 |
rotation axis |
Declared in include/datoviz/controller/arcball.h:152.
dvz_arcball_set()¶
Set the orientation directly from Euler angles.
DvzResult dvz_arcball_set(
DvzArcball * arcball,
vec3 angles
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
angles |
vec3 |
Euler angles |
Declared in include/datoviz/controller/arcball.h:141.
dvz_arcball_state()¶
Copy the current arcball state.
_Bool dvz_arcball_state(
const DvzArcball * arcball,
DvzArcballState * out
);
| Field | Type | Description |
|---|---|---|
| return | _Bool |
whether the state was written |
arcball |
const DvzArcball * |
arcball controller |
out |
DvzArcballState * |
target state snapshot |
Declared in include/datoviz/controller/arcball.h:182.
dvz_arcball_zoom()¶
Set the camera dolly factor.
DvzResult dvz_arcball_zoom(
DvzArcball * arcball,
float zoom
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
arcball |
DvzArcball * |
arcball controller |
zoom |
float |
uniform zoom factor |
Declared in include/datoviz/controller/arcball.h:162.
Types
DvzArcball · typedef
typedef struct DvzArcball DvzArcball;
Declared in include/datoviz/controller/arcball.h.
DvzArcballDesc · record
struct DvzArcballDesc {
uint32_t struct_size;
uint32_t flags;
float width;
float height;
uint32_t controller_flags;
};
Declared in include/datoviz/controller/arcball.h:81.
DvzArcballFlags · enum
enum DvzArcballFlags {
DVZ_ARCBALL_FLAGS_NONE = 0,
DVZ_ARCBALL_FLAGS_CONSTRAIN = 1,
};
Declared in include/datoviz/controller/arcball.h:41.
DvzArcballState · record
struct DvzArcballState {
float zoom;
vec2 pan;
_Bool interacting;
};
Declared in include/datoviz/controller/arcball.h:62.
Camera¶
Functions
dvz_camera_create()¶
Create a standalone camera.
DvzCamera * dvz_camera_create(
const DvzCameraDesc * desc
);
| Field | Type | Description |
|---|---|---|
| return | DvzCamera * |
the camera, or NULL on allocation failure |
desc |
const DvzCameraDesc * |
the camera descriptor, or NULL for defaults |
Related: dvz_camera_destroy().
Declared in include/datoviz/controller/camera.h:133.
dvz_camera_desc()¶
Return a default perspective camera descriptor.
DvzCameraDesc dvz_camera_desc(void);
| Field | Type | Description |
|---|---|---|
| return | DvzCameraDesc |
the camera descriptor |
Declared in include/datoviz/controller/camera.h:123.
dvz_camera_destroy()¶
Destroy a camera.
Use only with standalone cameras returned by dvz_camera_create(). Panel-owned cameras returned
by dvz_panel_set_camera_desc() or dvz_panel_camera() are destroyed with their owning panel/scene.
void dvz_camera_destroy(
DvzCamera * camera
);
| Field | Type | Description |
|---|---|---|
camera |
DvzCamera * |
the camera |
Related: dvz_camera_create().
Declared in include/datoviz/controller/camera.h:263.
dvz_camera_get_orthographic_bounds()¶
Return explicit orthographic projection bounds.
DvzResult dvz_camera_get_orthographic_bounds(
const DvzCamera * camera,
float * out_left,
float * out_right,
float * out_bottom,
float * out_top,
float * out_near,
float * out_far
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK when explicit bounds are active, DVZ_ERROR otherwise |
camera |
const DvzCamera * |
the camera |
out_left |
float * |
output left orthographic bound |
out_right |
float * |
output right orthographic bound |
out_bottom |
float * |
output bottom orthographic bound |
out_top |
float * |
output top orthographic bound |
out_near |
float * |
output near clipping plane |
out_far |
float * |
output far clipping plane |
Declared in include/datoviz/controller/camera.h:227.
dvz_camera_get_projection()¶
Return camera projection parameters.
void dvz_camera_get_projection(
const DvzCamera * camera,
DvzCameraProjection * out
);
| Field | Type | Description |
|---|---|---|
camera |
const DvzCamera * |
the camera |
out |
DvzCameraProjection * |
output camera projection |
Declared in include/datoviz/controller/camera.h:163.
dvz_camera_get_view()¶
Return a camera view transform.
void dvz_camera_get_view(
const DvzCamera * camera,
DvzCameraView * out
);
| Field | Type | Description |
|---|---|---|
camera |
const DvzCamera * |
the camera |
out |
DvzCameraView * |
output camera view |
Declared in include/datoviz/controller/camera.h:154.
dvz_camera_mvp()¶
Fill the view and projection matrices of an MVP struct from the camera state.
void dvz_camera_mvp(
DvzCamera * camera,
DvzMVP * mvp
);
| Field | Type | Description |
|---|---|---|
camera |
DvzCamera * |
the camera |
mvp |
DvzMVP * |
the MVP to update |
Declared in include/datoviz/controller/camera.h:251.
dvz_camera_projection()¶
Return a default perspective camera projection.
DvzCameraProjection dvz_camera_projection(void);
| Field | Type | Description |
|---|---|---|
| return | DvzCameraProjection |
the camera projection |
Declared in include/datoviz/controller/camera.h:114.
dvz_camera_resize()¶
Update the camera viewport size.
DvzResult dvz_camera_resize(
DvzCamera * camera,
float width,
float height
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
camera |
DvzCamera * |
the camera |
width |
float |
viewport width in pixels |
height |
float |
viewport height in pixels |
Declared in include/datoviz/controller/camera.h:241.
dvz_camera_set_orthographic()¶
Set orthographic projection parameters.
DvzResult dvz_camera_set_orthographic(
DvzCamera * camera,
float height,
float near,
float far
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
camera |
DvzCamera * |
the camera |
height |
float |
vertical world-space extent |
near |
float |
near clipping plane |
far |
float |
far clipping plane |
Declared in include/datoviz/controller/camera.h:190.
dvz_camera_set_orthographic_bounds()¶
Set explicit orthographic projection bounds.
This preserves the bounds exactly as supplied, including reversed left/right or bottom/top
pairs. Unlike dvz_camera_set_orthographic(), these bounds are not rewritten on resize.
DvzResult dvz_camera_set_orthographic_bounds(
DvzCamera * camera,
float left,
float right,
float bottom,
float top,
float near,
float far
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
camera |
DvzCamera * |
the camera |
left |
float |
left orthographic bound |
right |
float |
right orthographic bound |
bottom |
float |
bottom orthographic bound |
top |
float |
top orthographic bound |
near |
float |
near clipping plane |
far |
float |
far clipping plane |
Declared in include/datoviz/controller/camera.h:210.
dvz_camera_set_perspective()¶
Set perspective projection parameters.
DvzResult dvz_camera_set_perspective(
DvzCamera * camera,
float fov_y,
float near,
float far
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
camera |
DvzCamera * |
the camera |
fov_y |
float |
vertical field-of-view angle, in radians |
near |
float |
near clipping plane |
far |
float |
far clipping plane |
Declared in include/datoviz/controller/camera.h:176.
dvz_camera_set_view()¶
Set a camera view transform.
DvzResult dvz_camera_set_view(
DvzCamera * camera,
const DvzCameraView * view
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
camera |
DvzCamera * |
the camera |
view |
const DvzCameraView * |
the camera view |
Declared in include/datoviz/controller/camera.h:144.
dvz_camera_view()¶
Return a default camera view.
DvzCameraView dvz_camera_view(void);
| Field | Type | Description |
|---|---|---|
| return | DvzCameraView |
the camera view |
Declared in include/datoviz/controller/camera.h:105.
Types
DvzCamera · typedef
typedef struct DvzCamera DvzCamera;
Declared in include/datoviz/controller/camera.h.
DvzCameraDesc · record
struct DvzCameraDesc {
uint32_t struct_size;
uint32_t flags;
DvzCameraView view;
DvzCameraProjection projection;
};
Declared in include/datoviz/controller/camera.h:83.
DvzCameraProjection · record
struct DvzCameraProjection {
DvzCameraType type;
float fov_y;
float near_clip;
float far_clip;
float ortho_height;
};
Declared in include/datoviz/controller/camera.h:71.
DvzCameraType · enum
enum DvzCameraType {
DVZ_CAMERA_PERSPECTIVE = 0,
DVZ_CAMERA_ORTHOGRAPHIC = 1,
};
Declared in include/datoviz/controller/camera.h:41.
DvzCameraView · record
struct DvzCameraView {
vec3 eye;
vec3 target;
vec3 up;
};
Declared in include/datoviz/controller/camera.h:61.
DvzMVP · record
struct DvzMVP {
mat4 model;
mat4 view;
mat4 proj;
float time;
uint32_t flags;
};
Declared in include/datoviz/controller/panzoom.h:62.
DvzMVPFlags · enum
enum DvzMVPFlags {
DVZ_MVP_FLAGS_NONE = 0,
DVZ_MVP_FLAGS_ISOTROPIC_LOCAL = 1,
};
Declared in include/datoviz/controller/panzoom.h:72.
Fly¶
Functions
dvz_fly_apply_camera()¶
Apply the current fly pose to the attached camera.
DvzResult dvz_fly_apply_camera(
DvzFly * fly
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
Declared in include/datoviz/controller/fly.h:346.
dvz_fly_clear_pivot()¶
Clear the optional orbit pivot.
DvzResult dvz_fly_clear_pivot(
DvzFly * fly
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
Declared in include/datoviz/controller/fly.h:293.
dvz_fly_connect()¶
Subscribe the fly controller to an input router.
DvzResult dvz_fly_connect(
DvzFly * fly,
DvzInputRouter * router
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
router |
DvzInputRouter * |
input router |
Declared in include/datoviz/controller/fly.h:390.
dvz_fly_create()¶
Create a standalone fly camera controller.
DvzFly * dvz_fly_create(
const DvzFlyDesc * desc
);
| Field | Type | Description |
|---|---|---|
| return | DvzFly * |
the controller, or NULL on allocation failure |
desc |
const DvzFlyDesc * |
fly descriptor, or NULL for defaults |
Related: dvz_fly_destroy().
Declared in include/datoviz/controller/fly.h:113.
dvz_fly_desc()¶
Return a default fly-controller descriptor.
DvzFlyDesc dvz_fly_desc(void);
| Field | Type | Description |
|---|---|---|
| return | DvzFlyDesc |
the fly descriptor |
Declared in include/datoviz/controller/fly.h:103.
dvz_fly_destroy()¶
Destroy a fly controller.
void dvz_fly_destroy(
DvzFly * fly
);
| Field | Type | Description |
|---|---|---|
fly |
DvzFly * |
the fly controller |
Related: dvz_fly_create().
Declared in include/datoviz/controller/fly.h:410.
dvz_fly_disconnect()¶
Unsubscribe the fly controller from an input router.
DvzResult dvz_fly_disconnect(
DvzFly * fly,
DvzInputRouter * router
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
router |
DvzInputRouter * |
input router |
Declared in include/datoviz/controller/fly.h:401.
dvz_fly_get_position()¶
Return the current position.
void dvz_fly_get_position(
const DvzFly * fly,
vec3 out_pos
);
| Field | Type | Description |
|---|---|---|
fly |
const DvzFly * |
the fly controller |
out_pos |
vec3 |
output position |
Declared in include/datoviz/controller/fly.h:252.
dvz_fly_get_target()¶
Return the current look-at target.
void dvz_fly_get_target(
const DvzFly * fly,
vec3 out_target
);
| Field | Type | Description |
|---|---|---|
fly |
const DvzFly * |
the fly controller |
out_target |
vec3 |
output target |
Declared in include/datoviz/controller/fly.h:262.
dvz_fly_get_up()¶
Return the current up vector.
void dvz_fly_get_up(
const DvzFly * fly,
vec3 out_up
);
| Field | Type | Description |
|---|---|---|
fly |
const DvzFly * |
the fly controller |
out_up |
vec3 |
output up vector |
Declared in include/datoviz/controller/fly.h:272.
dvz_fly_has_pivot()¶
Return whether an orbit pivot is set.
_Bool dvz_fly_has_pivot(
const DvzFly * fly
);
| Field | Type | Description |
|---|---|---|
| return | _Bool |
whether the fly controller has a pivot |
fly |
const DvzFly * |
the fly controller |
Declared in include/datoviz/controller/fly.h:303.
dvz_fly_initial()¶
Set the initial pose from angles and reset.
DvzResult dvz_fly_initial(
DvzFly * fly,
vec3 position,
float yaw,
float pitch,
float roll
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
position |
vec3 |
initial camera position |
yaw |
float |
initial yaw angle in radians |
pitch |
float |
initial pitch angle in radians |
roll |
float |
initial roll angle in radians |
Declared in include/datoviz/controller/fly.h:163.
dvz_fly_initial_lookat()¶
Set the initial pose from a look-at point and reset.
DvzResult dvz_fly_initial_lookat(
DvzFly * fly,
vec3 position,
vec3 target
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
position |
vec3 |
initial camera position |
target |
vec3 |
initial look-at target |
Declared in include/datoviz/controller/fly.h:175.
dvz_fly_keyboard()¶
Process a keyboard event.
_Bool dvz_fly_keyboard(
DvzFly * fly,
const DvzKeyboardEvent * ev
);
| Field | Type | Description |
|---|---|---|
| return | _Bool |
true if the event was consumed |
fly |
DvzFly * |
the fly controller |
ev |
const DvzKeyboardEvent * |
keyboard event |
Declared in include/datoviz/controller/fly.h:379.
dvz_fly_look_at_pivot()¶
Reorient the camera toward the active pivot without moving the eye.
DvzResult dvz_fly_look_at_pivot(
DvzFly * fly
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
Declared in include/datoviz/controller/fly.h:313.
dvz_fly_move_forward()¶
Move forward along the active movement direction.
DvzResult dvz_fly_move_forward(
DvzFly * fly,
float amount
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
amount |
float |
movement amount in world units |
Declared in include/datoviz/controller/fly.h:197.
dvz_fly_move_right()¶
Move right relative to the active movement direction.
DvzResult dvz_fly_move_right(
DvzFly * fly,
float amount
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
amount |
float |
movement amount in world units |
Declared in include/datoviz/controller/fly.h:208.
dvz_fly_move_up()¶
Move up along the fly controller's world-up direction.
DvzResult dvz_fly_move_up(
DvzFly * fly,
float amount
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
amount |
float |
movement amount in world units |
Declared in include/datoviz/controller/fly.h:219.
dvz_fly_orbit()¶
Orbit the camera around the active pivot.
DvzResult dvz_fly_orbit(
DvzFly * fly,
float yaw_delta,
float pitch_delta
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
yaw_delta |
float |
yaw delta in radians |
pitch_delta |
float |
pitch delta in radians |
Declared in include/datoviz/controller/fly.h:325.
dvz_fly_pivot()¶
Set or move the optional orbit pivot while preserving the camera eye.
DvzResult dvz_fly_pivot(
DvzFly * fly,
vec3 pivot
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
pivot |
vec3 |
new world-space pivot point |
Declared in include/datoviz/controller/fly.h:283.
dvz_fly_pointer()¶
Process a pointer event.
_Bool dvz_fly_pointer(
DvzFly * fly,
const DvzPointerEvent * ev
);
| Field | Type | Description |
|---|---|---|
| return | _Bool |
true if the event was consumed |
fly |
DvzFly * |
the fly controller |
ev |
const DvzPointerEvent * |
pointer event |
Declared in include/datoviz/controller/fly.h:368.
dvz_fly_reset()¶
Reset a fly controller to its initial pose.
DvzResult dvz_fly_reset(
DvzFly * fly
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
Declared in include/datoviz/controller/fly.h:123.
dvz_fly_resize()¶
Update the viewport size.
DvzResult dvz_fly_resize(
DvzFly * fly,
float width,
float height
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
width |
float |
viewport width in pixels |
height |
float |
viewport height in pixels |
Declared in include/datoviz/controller/fly.h:149.
dvz_fly_roll()¶
Roll the fly camera around its view direction.
DvzResult dvz_fly_roll(
DvzFly * fly,
float dx
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
dx |
float |
roll delta in radians |
Declared in include/datoviz/controller/fly.h:242.
dvz_fly_rotate()¶
Rotate the fly view direction.
DvzResult dvz_fly_rotate(
DvzFly * fly,
float dx,
float dy
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
dx |
float |
yaw delta in radians |
dy |
float |
pitch delta in radians |
Declared in include/datoviz/controller/fly.h:231.
dvz_fly_set_camera()¶
Attach a camera updated by this fly controller.
DvzResult dvz_fly_set_camera(
DvzFly * fly,
DvzCamera * camera
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
camera |
DvzCamera * |
the camera to update, or NULL |
Declared in include/datoviz/controller/fly.h:336.
dvz_fly_set_mode()¶
Set the movement mode.
DvzResult dvz_fly_set_mode(
DvzFly * fly,
DvzFlyMode mode
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
mode |
DvzFlyMode |
movement mode |
Declared in include/datoviz/controller/fly.h:186.
dvz_fly_update()¶
Advance held-key movement.
DvzResult dvz_fly_update(
DvzFly * fly,
double dt
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
dt |
double |
elapsed time in seconds |
Declared in include/datoviz/controller/fly.h:357.
dvz_fly_viewport()¶
Update the viewport rectangle in window coordinates.
DvzResult dvz_fly_viewport(
DvzFly * fly,
float x,
float y,
float width,
float height
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
fly |
DvzFly * |
the fly controller |
x |
float |
viewport x origin in window pixels |
y |
float |
viewport y origin in window pixels |
width |
float |
viewport width in window pixels |
height |
float |
viewport height in window pixels |
Declared in include/datoviz/controller/fly.h:137.
Types
DvzFly · typedef
typedef struct DvzFly DvzFly;
Declared in include/datoviz/controller/fly.h.
DvzFlyDesc · record
struct DvzFlyDesc {
uint32_t struct_size;
uint32_t flags;
DvzFlyMode mode;
uint32_t controller_flags;
DvzCameraView initial_view;
float yaw;
float pitch;
float roll;
_Bool use_angles;
float speed;
float fast_multiplier;
float slow_multiplier;
float look_speed;
float wheel_speed;
};
Declared in include/datoviz/controller/fly.h:69.
DvzFlyFlags · enum
enum DvzFlyFlags {
DVZ_FLY_FLAGS_NONE = 0,
DVZ_FLY_FLAGS_INVERT_Y = 1,
DVZ_FLY_FLAGS_FIXED_UP = 2,
DVZ_FLY_FLAGS_DISABLE_ROLL = 4,
};
Declared in include/datoviz/controller/fly.h:46.
DvzFlyMode · enum
enum DvzFlyMode {
DVZ_FLY_MODE_FREE = 0,
DVZ_FLY_MODE_PLANE = 1,
};
Declared in include/datoviz/controller/fly.h:38.
Panzoom¶
Functions
dvz_panzoom_connect()¶
Subscribe the panzoom to an input router. The panzoom pointer callback will be registered; call dvz_panzoom_disconnect() to remove it.
DvzResult dvz_panzoom_connect(
DvzPanzoom * pz,
DvzInputRouter * router
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
pz |
DvzPanzoom * |
panzoom controller |
router |
DvzInputRouter * |
input router |
Declared in include/datoviz/controller/panzoom.h:330.
dvz_panzoom_create()¶
Create a standalone panzoom controller.
DvzPanzoom * dvz_panzoom_create(
const DvzPanzoomDesc * desc
);
| Field | Type | Description |
|---|---|---|
| return | DvzPanzoom * |
the controller, or NULL on allocation failure |
desc |
const DvzPanzoomDesc * |
panzoom descriptor, or NULL for defaults |
Related: dvz_panzoom_destroy().
Declared in include/datoviz/controller/panzoom.h:142.
dvz_panzoom_desc()¶
Return the default standalone panzoom descriptor.
The default viewport is 800 by 600 pixels and no controller flags are enabled.
DvzPanzoomDesc dvz_panzoom_desc(void);
| Field | Type | Description |
|---|---|---|
| return | DvzPanzoomDesc |
a fully initialized descriptor that callers may modify |
Declared in include/datoviz/controller/panzoom.h:132.
dvz_panzoom_destroy()¶
Destroy a standalone panzoom controller.
The controller must have been unsubscribed from any input router before this call.
void dvz_panzoom_destroy(
DvzPanzoom * pz
);
| Field | Type | Description |
|---|---|---|
pz |
DvzPanzoom * |
the owned panzoom controller to destroy; must not be NULL |
Related: dvz_panzoom_create().
Declared in include/datoviz/controller/panzoom.h:352.
dvz_panzoom_disconnect()¶
Unsubscribe the panzoom from a router.
DvzResult dvz_panzoom_disconnect(
DvzPanzoom * pz,
DvzInputRouter * router
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
pz |
DvzPanzoom * |
panzoom controller |
router |
DvzInputRouter * |
input router |
Declared in include/datoviz/controller/panzoom.h:341.
dvz_panzoom_end()¶
Commit the current pan/zoom as the new drag baseline (call at drag stop).
DvzResult dvz_panzoom_end(
DvzPanzoom * pz
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
pz |
DvzPanzoom * |
panzoom controller |
Declared in include/datoviz/controller/panzoom.h:277.
dvz_panzoom_extent()¶
Return the visible extent in visual coordinates.
_Bool dvz_panzoom_extent(
const DvzPanzoom * pz,
float[4] out
);
| Field | Type | Description |
|---|---|---|
| return | _Bool |
whether the extent was written |
pz |
const DvzPanzoom * |
the panzoom controller |
out |
float[4] |
extent as xmin, xmax, ymin, ymax |
Declared in include/datoviz/controller/panzoom.h:221.
dvz_panzoom_mvp()¶
Fill the view and proj matrices of an MVP struct from the current panzoom state.
The model matrix is left untouched.
void dvz_panzoom_mvp(
DvzPanzoom * pz,
DvzMVP * mvp
);
| Field | Type | Description |
|---|---|---|
pz |
DvzPanzoom * |
the panzoom controller; must not be NULL |
mvp |
DvzMVP * |
output MVP state whose view and projection matrices are replaced; must not be NULL |
Declared in include/datoviz/controller/panzoom.h:289.
dvz_panzoom_pan()¶
Set the pan offset in NDC.
DvzResult dvz_panzoom_pan(
DvzPanzoom * pz,
vec2 pan
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
pz |
DvzPanzoom * |
panzoom controller |
pan |
vec2 |
pan offset |
Declared in include/datoviz/controller/panzoom.h:189.
dvz_panzoom_pan_shift()¶
Apply a pan shift (pixel delta).
DvzResult dvz_panzoom_pan_shift(
DvzPanzoom * pz,
vec2 shift_px,
vec2 center_px
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
pz |
DvzPanzoom * |
panzoom controller |
shift_px |
vec2 |
shift in viewport pixels |
center_px |
vec2 |
pointer center in viewport pixels |
Declared in include/datoviz/controller/panzoom.h:243.
dvz_panzoom_pointer()¶
Process a pointer event and update panzoom state.
The event is borrowed for the duration of the call. Events outside the configured viewport are not consumed.
_Bool dvz_panzoom_pointer(
DvzPanzoom * pz,
const DvzPointerEvent * ev
);
| Field | Type | Description |
|---|---|---|
| return | _Bool |
true if the event was consumed |
pz |
DvzPanzoom * |
the panzoom controller; must not be NULL |
ev |
const DvzPointerEvent * |
the pointer event to process, in window coordinates; must not be NULL |
Declared in include/datoviz/controller/panzoom.h:318.
dvz_panzoom_reset()¶
Reset to the identity transform.
DvzResult dvz_panzoom_reset(
DvzPanzoom * pz
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
pz |
DvzPanzoom * |
panzoom controller |
Declared in include/datoviz/controller/panzoom.h:152.
dvz_panzoom_resize()¶
Update the viewport size (call on window resize).
DvzResult dvz_panzoom_resize(
DvzPanzoom * pz,
float width,
float height
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
pz |
DvzPanzoom * |
panzoom controller |
width |
float |
viewport width in pixels |
height |
float |
viewport height in pixels |
Declared in include/datoviz/controller/panzoom.h:164.
dvz_panzoom_resolve()¶
Resolve panzoom state against a caller-provided base visual extent.
On success, the model matrix is identity and the output contains the resolved view and orthographic projection matrices plus the visible extent in the base extent's coordinates.
_Bool dvz_panzoom_resolve(
const DvzPanzoom * panzoom,
const DvzPanzoomEval * eval,
DvzPanzoomResolved * out
);
| Field | Type | Description |
|---|---|---|
| return | _Bool |
true on success, false if the extent or zoom state is invalid |
panzoom |
const DvzPanzoom * |
the panzoom controller; must not be NULL |
eval |
const DvzPanzoomEval * |
borrowed evaluation parameters containing a finite, non-empty base extent |
out |
DvzPanzoomResolved * |
output resolved MVP and visible extent; must not be NULL |
Declared in include/datoviz/controller/panzoom.h:303.
dvz_panzoom_state()¶
Copy the current panzoom state.
_Bool dvz_panzoom_state(
const DvzPanzoom * pz,
DvzPanzoomState * out
);
| Field | Type | Description |
|---|---|---|
| return | _Bool |
whether the state was written |
pz |
const DvzPanzoom * |
the panzoom controller |
out |
DvzPanzoomState * |
target state snapshot |
Declared in include/datoviz/controller/panzoom.h:231.
dvz_panzoom_viewport()¶
Update the viewport rectangle in window coordinates.
DvzResult dvz_panzoom_viewport(
DvzPanzoom * pz,
float x,
float y,
float width,
float height
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
pz |
DvzPanzoom * |
panzoom controller |
x |
float |
viewport x origin in window pixels |
y |
float |
viewport y origin in window pixels |
width |
float |
viewport width in window pixels |
height |
float |
viewport height in window pixels |
Declared in include/datoviz/controller/panzoom.h:178.
dvz_panzoom_zoom()¶
Set the zoom factors.
DvzResult dvz_panzoom_zoom(
DvzPanzoom * pz,
vec2 zoom
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
pz |
DvzPanzoom * |
panzoom controller |
zoom |
vec2 |
zoom factors |
Declared in include/datoviz/controller/panzoom.h:200.
dvz_panzoom_zoom_limits()¶
Set zoom limits.
_Bool dvz_panzoom_zoom_limits(
DvzPanzoom * pz,
vec2 min_zoom,
vec2 max_zoom
);
| Field | Type | Description |
|---|---|---|
| return | _Bool |
whether the limits were accepted |
pz |
DvzPanzoom * |
the panzoom controller |
min_zoom |
vec2 |
minimum zoom factors |
max_zoom |
vec2 |
maximum zoom factors |
Declared in include/datoviz/controller/panzoom.h:211.
dvz_panzoom_zoom_shift()¶
Apply a zoom shift driven by right-drag (pixel delta + anchor).
DvzResult dvz_panzoom_zoom_shift(
DvzPanzoom * pz,
vec2 shift_px,
vec2 center_px
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
pz |
DvzPanzoom * |
panzoom controller |
shift_px |
vec2 |
shift in viewport pixels |
center_px |
vec2 |
zoom anchor in viewport pixels |
Declared in include/datoviz/controller/panzoom.h:255.
dvz_panzoom_zoom_wheel()¶
Apply a wheel zoom.
DvzResult dvz_panzoom_zoom_wheel(
DvzPanzoom * pz,
vec2 dir,
vec2 center_px
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
pz |
DvzPanzoom * |
panzoom controller |
dir |
vec2 |
wheel direction |
center_px |
vec2 |
zoom anchor in viewport pixels |
Declared in include/datoviz/controller/panzoom.h:267.
Types
DvzPanzoom · typedef
typedef struct DvzPanzoom DvzPanzoom;
Declared in include/datoviz/controller/panzoom.h.
DvzPanzoomDesc · record
struct DvzPanzoomDesc {
uint32_t struct_size;
uint32_t flags;
float width;
float height;
uint32_t controller_flags;
};
Declared in include/datoviz/controller/panzoom.h:114.
DvzPanzoomEval · record
struct DvzPanzoomEval {
float[4] base_extent;
float viewport_width;
float viewport_height;
};
Declared in include/datoviz/controller/panzoom.h:88.
DvzPanzoomFlags · enum
enum DvzPanzoomFlags {
DVZ_PANZOOM_FLAGS_NONE = 0,
DVZ_PANZOOM_FLAGS_FIXED_X = 1,
DVZ_PANZOOM_FLAGS_FIXED_Y = 2,
DVZ_PANZOOM_FLAGS_KEEP_ASPECT = 4,
};
Declared in include/datoviz/controller/panzoom.h:36.
DvzPanzoomResolved · record
struct DvzPanzoomResolved {
DvzMVP mvp;
float[4] visible_extent;
};
Declared in include/datoviz/controller/panzoom.h:96.
DvzPanzoomState · record
struct DvzPanzoomState {
vec2 pan;
vec2 zoom;
_Bool interacting;
};
Declared in include/datoviz/controller/panzoom.h:80.
Turntable¶
Functions
dvz_turntable_apply_camera()¶
Apply the turntable pose to the attached camera.
DvzResult dvz_turntable_apply_camera(
DvzTurntable * turntable
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
turntable |
DvzTurntable * |
the turntable controller |
Declared in include/datoviz/controller/turntable.h:211.
dvz_turntable_connect()¶
Subscribe the turntable to an input router.
DvzResult dvz_turntable_connect(
DvzTurntable * turntable,
DvzInputRouter * router
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
turntable |
DvzTurntable * |
the turntable controller |
router |
DvzInputRouter * |
input router |
Declared in include/datoviz/controller/turntable.h:233.
dvz_turntable_create()¶
Create a standalone turntable controller.
DvzTurntable * dvz_turntable_create(
const DvzTurntableDesc * desc
);
| Field | Type | Description |
|---|---|---|
| return | DvzTurntable * |
the controller, or NULL on allocation failure |
desc |
const DvzTurntableDesc * |
descriptor, or NULL for defaults |
Related: dvz_turntable_destroy().
Declared in include/datoviz/controller/turntable.h:105.
dvz_turntable_desc()¶
Return a default turntable descriptor.
DvzTurntableDesc dvz_turntable_desc(void);
| Field | Type | Description |
|---|---|---|
| return | DvzTurntableDesc |
the turntable descriptor |
Declared in include/datoviz/controller/turntable.h:95.
dvz_turntable_destroy()¶
Destroy a turntable controller.
void dvz_turntable_destroy(
DvzTurntable * turntable
);
| Field | Type | Description |
|---|---|---|
turntable |
DvzTurntable * |
the turntable controller |
Related: dvz_turntable_create().
Declared in include/datoviz/controller/turntable.h:253.
dvz_turntable_disconnect()¶
Unsubscribe the turntable from an input router.
DvzResult dvz_turntable_disconnect(
DvzTurntable * turntable,
DvzInputRouter * router
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
turntable |
DvzTurntable * |
the turntable controller |
router |
DvzInputRouter * |
input router |
Declared in include/datoviz/controller/turntable.h:244.
dvz_turntable_dolly()¶
Dolly toward or away from the pivot.
DvzResult dvz_turntable_dolly(
DvzTurntable * turntable,
float amount
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
turntable |
DvzTurntable * |
the turntable controller |
amount |
float |
distance delta |
Declared in include/datoviz/controller/turntable.h:177.
dvz_turntable_orbit()¶
Orbit around the pivot.
DvzResult dvz_turntable_orbit(
DvzTurntable * turntable,
float yaw_delta,
float pitch_delta
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
turntable |
DvzTurntable * |
the turntable controller |
yaw_delta |
float |
yaw delta in radians |
pitch_delta |
float |
pitch delta in radians |
Declared in include/datoviz/controller/turntable.h:166.
dvz_turntable_pan()¶
Pan the pivot in the current view plane.
DvzResult dvz_turntable_pan(
DvzTurntable * turntable,
float right_amount,
float up_amount
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
turntable |
DvzTurntable * |
the turntable controller |
right_amount |
float |
right-axis pan amount |
up_amount |
float |
up-axis pan amount |
Declared in include/datoviz/controller/turntable.h:190.
dvz_turntable_pivot()¶
Set the pivot while preserving the current camera eye.
DvzResult dvz_turntable_pivot(
DvzTurntable * turntable,
vec3 pivot
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
turntable |
DvzTurntable * |
the turntable controller |
pivot |
vec3 |
new world-space pivot |
Declared in include/datoviz/controller/turntable.h:153.
dvz_turntable_pointer()¶
Process a pointer event.
_Bool dvz_turntable_pointer(
DvzTurntable * turntable,
const DvzPointerEvent * ev
);
| Field | Type | Description |
|---|---|---|
| return | _Bool |
true if the event was consumed |
turntable |
DvzTurntable * |
the turntable controller |
ev |
const DvzPointerEvent * |
pointer event |
Declared in include/datoviz/controller/turntable.h:222.
dvz_turntable_reset()¶
Reset a turntable to its initial pose.
DvzResult dvz_turntable_reset(
DvzTurntable * turntable
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
turntable |
DvzTurntable * |
the turntable controller |
Declared in include/datoviz/controller/turntable.h:115.
dvz_turntable_resize()¶
Update the viewport size.
DvzResult dvz_turntable_resize(
DvzTurntable * turntable,
float width,
float height
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
turntable |
DvzTurntable * |
the turntable controller |
width |
float |
viewport width in pixels |
height |
float |
viewport height in pixels |
Declared in include/datoviz/controller/turntable.h:142.
dvz_turntable_set_camera()¶
Attach a camera updated by this turntable.
DvzResult dvz_turntable_set_camera(
DvzTurntable * turntable,
DvzCamera * camera
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
turntable |
DvzTurntable * |
the turntable controller |
camera |
DvzCamera * |
the camera to update, or NULL |
Declared in include/datoviz/controller/turntable.h:201.
dvz_turntable_viewport()¶
Update the viewport rectangle in window coordinates.
DvzResult dvz_turntable_viewport(
DvzTurntable * turntable,
float x,
float y,
float width,
float height
);
| Field | Type | Description |
|---|---|---|
| return | DvzResult |
DVZ_OK on success, DVZ_ERROR on validation error |
turntable |
DvzTurntable * |
the turntable controller |
x |
float |
viewport x origin in window pixels |
y |
float |
viewport y origin in window pixels |
width |
float |
viewport width in window pixels |
height |
float |
viewport height in window pixels |
Declared in include/datoviz/controller/turntable.h:130.
Types
DvzTurntable · typedef
typedef struct DvzTurntable DvzTurntable;
Declared in include/datoviz/controller/turntable.h.
DvzTurntableDesc · record
struct DvzTurntableDesc {
uint32_t struct_size;
uint32_t flags;
DvzCameraView initial_view;
float yaw_speed;
float pitch_speed;
float zoom_speed;
float pan_speed;
float min_pitch;
float max_pitch;
float min_distance;
float max_distance;
uint32_t controller_flags;
};
Declared in include/datoviz/controller/turntable.h:63.
DvzTurntableFlags · enum
enum DvzTurntableFlags {
DVZ_TURNTABLE_FLAGS_NONE = 0,
DVZ_TURNTABLE_FLAGS_INVERT_Y = 1,
DVZ_TURNTABLE_FLAGS_ALLOW_PAN = 2,
DVZ_TURNTABLE_FLAGS_WRAP_YAW = 4,
DVZ_TURNTABLE_FLAGS_CLAMP_DISTANCE = 8,
};
Declared in include/datoviz/controller/turntable.h:39.