pub struct TrackballInput {Show 28 fields
pub velocity: TrackballVelocity,
pub wheel_unit: TrackballWheelUnit,
pub focus: bool,
pub gamer_key: Option<KeyCode>,
pub ortho_key: Option<KeyCode>,
pub reset_key: Option<KeyCode>,
pub first_button: Option<MouseButton>,
pub first_key: Option<KeyCode>,
pub first_left_key: Option<KeyCode>,
pub first_right_key: Option<KeyCode>,
pub first_up_key: Option<KeyCode>,
pub first_down_key: Option<KeyCode>,
pub orbit_button: Option<MouseButton>,
pub screw_left_key: Option<KeyCode>,
pub screw_right_key: Option<KeyCode>,
pub orbit_left_key: Option<KeyCode>,
pub orbit_right_key: Option<KeyCode>,
pub orbit_up_key: Option<KeyCode>,
pub orbit_down_key: Option<KeyCode>,
pub slide_button: Option<MouseButton>,
pub slide_left_key: Option<KeyCode>,
pub slide_right_key: Option<KeyCode>,
pub slide_up_key: Option<KeyCode>,
pub slide_down_key: Option<KeyCode>,
pub slide_far_key: Option<KeyCode>,
pub slide_near_key: Option<KeyCode>,
pub scale_in_key: Option<KeyCode>,
pub scale_out_key: Option<KeyCode>,
}
Expand description
Trackball controller input mappings and settings.
Fields§
§velocity: TrackballVelocity
Trackball velocity for time-based input like pressed keys.
wheel_unit: TrackballWheelUnit
Wheel unit for coherent scaling. Default is 24 clicks per turn.
Device dependent setting as mouse wheel events usually lack a reference unit.
focus: bool
Enables focus operation. Default is true
.
Whether to slide towards mouse or single-finger touch position when Self::orbit_button
is just pressed and released again or single-finger gesture is just started and ended again.
Moving the cursor/finger slightly between pressed/started and released/ended events discards
the focus operation in favor of the orbit operation.
gamer_key: Option<KeyCode>
Key used to toggle esdf
/wasd
mapping. Default is KeyCode::KeyM
.
ortho_key: Option<KeyCode>
Key used to toggle projection mode. Default is KeyCode::KeyP
.
reset_key: Option<KeyCode>
Key used to reset frame. Default is KeyCode::Enter
.
Mouse button used to look around. Default is MouseButton::Middle
.
first_key: Option<KeyCode>
Key used to look around with single-finger touch. Default is KeyCode::ShiftLeft
.
first_left_key: Option<KeyCode>
Key used to look left. Default is KeyCode::ArrowLeft
.
first_right_key: Option<KeyCode>
Key used to look right. Default is KeyCode::ArrowRight
.
first_up_key: Option<KeyCode>
Key used to look up. Default is KeyCode::ArrowUp
.
first_down_key: Option<KeyCode>
Key used to look down. Default is KeyCode::ArrowDown
.
Mouse button used to orbit camera. Default is MouseButton::Left
.
screw_left_key: Option<KeyCode>
Key used to screw/roll left. Default is KeyCode::KeyU
.
screw_right_key: Option<KeyCode>
Key used to screw/roll right. Default is KeyCode::KeyO
.
orbit_left_key: Option<KeyCode>
Key used to orbit left. Default is KeyCode::KeyJ
.
orbit_right_key: Option<KeyCode>
Key used to orbit right. Default is KeyCode::KeyL
.
orbit_up_key: Option<KeyCode>
Key used to orbit up. Default is KeyCode::KeyI
.
orbit_down_key: Option<KeyCode>
Key used to orbit down. Default is KeyCode::KeyK
.
Mouse button used to slide camera. Default is MouseButton::Right
.
slide_left_key: Option<KeyCode>
Key used to slide left. Default is KeyCode::KeyS
.
slide_right_key: Option<KeyCode>
Key used to slide right. Default is KeyCode::KeyF
.
slide_up_key: Option<KeyCode>
Key used to slide up. Default is KeyCode::KeyE
.
slide_down_key: Option<KeyCode>
Key used to slide up. Default is KeyCode::KeyD
.
slide_far_key: Option<KeyCode>
Key used to slide far. Default is KeyCode::KeyG
.
slide_near_key: Option<KeyCode>
Key used to slide near. Default is KeyCode::KeyV
.
scale_in_key: Option<KeyCode>
Key used to scale/zoom in. Default is KeyCode::KeyH
.
scale_out_key: Option<KeyCode>
Key used to scale/zoom out. Default is KeyCode::KeyN
.
Implementations§
Source§impl TrackballInput
impl TrackballInput
Sourcepub const fn map_esdf(&mut self)
pub const fn map_esdf(&mut self)
Maps esdf
/gv
to slide operations.
Key | Operation |
---|---|
e | Slides up. |
s | Slides left. |
d | Slides down. |
f | Slides right. |
g | Slides far (in/forward). |
v | Slides near (out/backward). |
This mapping is symmetric to the ijkl
/hn
orbit mapping but less intuitive to gamers
compared with Self::map_wasd
.
Sourcepub const fn map_wasd(&mut self)
pub const fn map_wasd(&mut self)
Maps wasd
/Space
/ControlLeft
to slide operations.
Key | Operation |
---|---|
w | Slides far (in/forward). |
a | Slides left. |
s | Slides near (out/backward). |
d | Slides right. |
Space | Slides up (jump). |
ControlLeft | Slides down (crouch). |
This mapping isn’t symmetric to the ijkl
/hn
orbit mapping but more intuitive to gamers
compared with Self::map_esdf
.
Trait Implementations§
Source§impl Clone for TrackballInput
impl Clone for TrackballInput
Source§fn clone(&self) -> TrackballInput
fn clone(&self) -> TrackballInput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Component for TrackballInput
impl Component for TrackballInput
Source§const STORAGE_TYPE: StorageType = bevy::ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy::ecs::component::StorageType::Table
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>
],
while immutable components will instead have [Component<Mutability = Immutable>
]. Read moreSource§fn register_required_components(
requiree: ComponentId,
components: &mut ComponentsRegistrator<'_>,
required_components: &mut RequiredComponents,
inheritance_depth: u16,
recursion_check_stack: &mut Vec<ComponentId>,
)
fn register_required_components( requiree: ComponentId, components: &mut ComponentsRegistrator<'_>, required_components: &mut RequiredComponents, inheritance_depth: u16, recursion_check_stack: &mut Vec<ComponentId>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn register_component_hooks(hooks: &mut ComponentHooks)
fn register_component_hooks(hooks: &mut ComponentHooks)
Component::on_add
, etc.)ComponentHooks
.Source§fn on_add() -> Option<for<'w> fn(_: DeferredWorld<'w>, _: HookContext)>
fn on_add() -> Option<for<'w> fn(_: DeferredWorld<'w>, _: HookContext)>
Source§fn on_insert() -> Option<for<'w> fn(_: DeferredWorld<'w>, _: HookContext)>
fn on_insert() -> Option<for<'w> fn(_: DeferredWorld<'w>, _: HookContext)>
Source§fn on_replace() -> Option<for<'w> fn(_: DeferredWorld<'w>, _: HookContext)>
fn on_replace() -> Option<for<'w> fn(_: DeferredWorld<'w>, _: HookContext)>
Source§fn on_remove() -> Option<for<'w> fn(_: DeferredWorld<'w>, _: HookContext)>
fn on_remove() -> Option<for<'w> fn(_: DeferredWorld<'w>, _: HookContext)>
Source§fn on_despawn() -> Option<for<'w> fn(_: DeferredWorld<'w>, _: HookContext)>
fn on_despawn() -> Option<for<'w> fn(_: DeferredWorld<'w>, _: HookContext)>
Source§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper
. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component
, this is populated by annotating fields containing entities with #[entities]
Read moreSource§impl Debug for TrackballInput
impl Debug for TrackballInput
Auto Trait Implementations§
impl Freeze for TrackballInput
impl RefUnwindSafe for TrackballInput
impl Send for TrackballInput
impl Sync for TrackballInput
impl Unpin for TrackballInput
impl UnwindSafe for TrackballInput
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ids: &mut impl FnMut(ComponentId), )
Source§fn register_required_components(
components: &mut ComponentsRegistrator<'_>,
required_components: &mut RequiredComponents,
)
fn register_required_components( components: &mut ComponentsRegistrator<'_>, required_components: &mut RequiredComponents, )
Bundle
.Source§fn get_component_ids(
components: &Components,
ids: &mut impl FnMut(Option<ComponentId>),
)
fn get_component_ids( components: &Components, ids: &mut impl FnMut(Option<ComponentId>), )
Source§impl<C> BundleFromComponents for Cwhere
C: Component,
impl<C> BundleFromComponents for Cwhere
C: Component,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
fn get_components( self, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.