Crate egui_gizmo

Source
Expand description

Provides a 3d transformation gizmo that can be used to manipulate 4x4 transformation matrices. Such gizmos are commonly used in applications such as game engines and 3d modeling software.

§Creating a gizmo

For a more complete example, see the online demo at https://urholaukkarinen.github.io/egui-gizmo/. The demo sources can be found at https://github.com/urholaukkarinen/egui-gizmo/blob/main/demo/src/main.rs.

§A basic example

let gizmo = Gizmo::new("My gizmo")
    .view_matrix(view_matrix)
    .projection_matrix(projection_matrix)
    .model_matrix(model_matrix)
    .mode(GizmoMode::Rotate);

if let Some(response) = gizmo.interact(ui) {
    model_matrix = response.transform();
}

The gizmo can be placed inside a container such as a egui::Window or an egui::Area. By default, the gizmo will use the ui clip rect as a viewport. The gizmo will apply transformations to the given model matrix.

Structs§

Gizmo
GizmoResult
Result of an active transformation
GizmoVisuals
Controls the visual style of the gizmo

Enums§

GizmoDirection
GizmoMode
GizmoOrientation

Constants§

DEFAULT_SNAP_ANGLE
The default snapping distance for rotation in radians
DEFAULT_SNAP_DISTANCE
The default snapping distance for translation
DEFAULT_SNAP_SCALE
The default snapping distance for scale