Struct egui_gizmo::Gizmo

source ·
pub struct Gizmo { /* private fields */ }

Implementations§

source§

impl Gizmo

source

pub fn new(id_source: impl Hash) -> Self

source

pub fn model_matrix(self, model_matrix: ColumnMatrix4<f32>) -> Self

Matrix that specifies translation and rotation of the gizmo in world space

source

pub fn view_matrix(self, view_matrix: ColumnMatrix4<f32>) -> Self

Matrix that specifies translation and rotation of the viewport camera

source

pub fn projection_matrix(self, projection_matrix: ColumnMatrix4<f32>) -> Self

Matrix that specifies projection of the viewport

source

pub const fn viewport(self, viewport: Rect) -> Self

Bounds of the viewport in pixels

source

pub const fn mode(self, mode: GizmoMode) -> Self

Gizmo mode to use

source

pub const fn orientation(self, orientation: GizmoOrientation) -> Self

Gizmo orientation to use

source

pub const fn snapping(self, snapping: bool) -> Self

Whether snapping is enabled

source

pub const fn snap_angle(self, snap_angle: f32) -> Self

Snap angle to use for rotation when snapping is enabled

source

pub const fn snap_distance(self, snap_distance: f32) -> Self

Snap distance to use for translation when snapping is enabled

source

pub const fn snap_scale(self, snap_scale: f32) -> Self

Snap distance to use for scaling when snapping is enabled

source

pub const fn visuals(self, visuals: GizmoVisuals) -> Self

Visual configuration of the gizmo, such as colors and size

source

pub fn interact(self, ui: &mut Ui) -> Option<GizmoResult>

Draw and interact with the gizmo. This consumes the gizmo.

Returns the result of the interaction, which includes a transformed model matrix. None is returned when the gizmo is not active.

Auto Trait Implementations§

§

impl Freeze for Gizmo

§

impl !RefUnwindSafe for Gizmo

§

impl !Send for Gizmo

§

impl !Sync for Gizmo

§

impl Unpin for Gizmo

§

impl !UnwindSafe for Gizmo

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.