pub struct Touch<F: Debug + Eq, N: Copy + RealField> { /* private fields */ }
Expand description

Touch gestures inducing slide, orbit, scale, and focus.

Implements Default and can be created with Touch::default().

All methods except Self::fingers() must be invoked on matching events fired by your 3D graphics library of choice.

Implementations

Computes centroid position, roll angle, and scale ratio from finger gestures.

Parameters are:

  • fid as generic finger ID like Some(id) for touch and None for mouse events,
  • pos as current cursor/finger position in screen space,
  • mvs as number of finger moves for debouncing potential finger tap gesture with zero resulting in no delay of non-tap gestures while tap gesture can still be recognized. Use zero unless tap gestures are hardly recognized.

Returns number of fingers, centroid position, roll angle, and scale ratio in screen space in the order mentioned or None when debouncing tap gesture with non-vanishing mvs. See Self::discard() for tap gesture result.

Panics

Panics with more than ten fingers.

Removes finger position and returns number of fingers and centroid position of tap gesture.

Returns None as long as there are finger positions or no tap gesture has been recognized.

Panics

Panics if generic finger ID fid is unknown.

Number of fingers.

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

Returns the “default value” for a type. 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.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

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.