logo
pub enum TouchInput {
    Started {
        finger_id: u32,
        pos: Vec2,
        ray_origin: Vec3,
        ray_dir: Vec3,
    },
    Ended {
        finger_id: u32,
        pos: Vec2,
        ray_origin: Vec3,
        ray_dir: Vec3,
    },
    Move {
        finger_id: u32,
        pos: Vec2,
        ray_origin: Vec3,
        ray_dir: Vec3,
    },
    RelativeMove {
        finger_id: u32,
        delta_logical_pixels: Vec2,
        delta_angle: Vec2,
    },
}
Expand description

Represents a touch input event.

Variants

Started

Fields

finger_id: u32

Unique identifier of a finger

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.

Every time a user touches the screen a new TouchInput::Started event is generated

Ended

Fields

finger_id: u32

Unique identifier of a finger

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.

When the finger is lifted, an TouchInput::Ended event is generated

Move

Fields

finger_id: u32

Unique identifier of a finger

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.

After a TouchInput::Started event has been emitted, there may be zero or more TouchInput::Move events when the finger is moved.

RelativeMove

Fields

finger_id: u32

Unique identifier of a finger

delta_logical_pixels: Vec2

Movement delta in logical pixels (approximate).

delta_angle: Vec2

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

After a TouchInput::Started event has been emitted, there may be zero or more TouchInput::RelativeMove events when the finger is moved.

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.