logo
pub enum MouseInput {
    Move {
        pos: Vec2,
        ray_origin: Vec3,
        ray_dir: Vec3,
    },
    ButtonPress {
        button: MouseButton,
        pos: Vec2,
        ray_origin: Vec3,
        ray_dir: Vec3,
    },
    ButtonRelease {
        button: MouseButton,
        pos: Vec2,
        ray_origin: Vec3,
        ray_dir: Vec3,
    },
    RelativeMove {
        delta_logical_pixels: Vec2,
        delta_angle: Vec2,
    },
    Scroll {
        delta: Vec2,
    },
}
Expand description

Represents a mouse input event.

Variants

Move

Fields

pos: Vec2

Coordinate in logical pixels

ray_origin: Vec3

World space origin of the ray (intersect this to find what you clicked on).

ray_dir: Vec3

World space direction of the ray.

Mouse move

ButtonPress

Fields

button: MouseButton

Which pointer button was pressed

pos: Vec2

Coordinate in logical pixels

ray_origin: Vec3

World space origin of the click ray (intersect this to find what you clicked on).

ray_dir: Vec3

World space direction of the click ray.

Mouse button press

ButtonRelease

Fields

button: MouseButton

Which pointer button was released

pos: Vec2

Coordinate in logical pixels

ray_origin: Vec3

World space origin of the click ray (intersect this to find what you clicked on).

ray_dir: Vec3

World space direction of the click ray.

Mouse button release

RelativeMove

Fields

delta_logical_pixels: Vec2

Raw (unaccelerated) mouse movement in unspecified units. Different devices may use different units, but in practice it should be close to logical pixels.

delta_angle: Vec2

Movement delta in radians. This is affected by the ark “mouse sensitivity” setting as well as “invert y axis”.

Relative cursor movement (higher precision, works at screen border).

This event is disabled and won’t be emitted when the window is not focused or when the Ark developer UI is visible. Press tab to show and hide the developer UI.

Scroll

Fields

delta: Vec2

Movement vector

Mouse wheel/trackpad scroll movement.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.