pub struct PointerState {
pub pos: Option<Vec2>,
pub ray: Option<Ray3>,
pub primary: bool,
pub secondary: bool,
pub middle: bool,
pub touch_id: Option<TouchId>,
}
Expand description
The state of the pointer (mouse or touch).
Fields
pos: Option<Vec2>
Logical point position of the pointer (mouse or touch).
Can be None
if mouse is not on screen, or if there are no touches.
In case of multiple simultaneous touches, this will correspond to the first touch.
ray: Option<Ray3>
World-space ray of the pointer (mouse or touch).
Can be None
if mouse is not on screen, or if there are no touches.
In case of multiple simultaneous touches, this will correspond to the first touch.
primary: bool
True if the primary button is currently down.
Left mouse button on most mice.
This is also set to true
for the primary touch.
secondary: bool
True if the secondary button is currently down. Left mouse button on most mice.
middle: bool
True if the middle mouse button is currently down.
touch_id: Option<TouchId>
The id of the first touch that went down (in case there are several touches).
This is the touch that is being represented by PointerState
.
Implementations
sourceimpl PointerState
impl PointerState
Any mouse button is down (always true
for primary touches).
Trait Implementations
sourceimpl Clone for PointerState
impl Clone for PointerState
sourcefn clone(&self) -> PointerState
fn clone(&self) -> PointerState
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PointerState
impl Debug for PointerState
sourceimpl Default for PointerState
impl Default for PointerState
sourcefn default() -> PointerState
fn default() -> PointerState
Returns the “default value” for a type. Read more
sourceimpl PartialEq<PointerState> for PointerState
impl PartialEq<PointerState> for PointerState
sourcefn eq(&self, other: &PointerState) -> bool
fn eq(&self, other: &PointerState) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl Copy for PointerState
impl StructuralPartialEq for PointerState
Auto Trait Implementations
impl RefUnwindSafe for PointerState
impl Send for PointerState
impl Sync for PointerState
impl Unpin for PointerState
impl UnwindSafe for PointerState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more