pub enum EventSignal {
Show 24 variants
ParentChanged {
child: ComponentId,
old_parent: Option<ComponentId>,
new_parent: Option<ComponentId>,
},
RayIntersected {
raycaster: ComponentId,
renderable: ComponentId,
t: f32,
origin: [f32; 3],
dir: [f32; 3],
},
CollisionStarted {
a: ComponentId,
b: ComponentId,
delta: [f32; 3],
},
CollisionEnded {
a: ComponentId,
b: ComponentId,
delta: [f32; 3],
},
DragStart {
raycaster: ComponentId,
renderable: ComponentId,
hit_point: [f32; 3],
ray_dir_world: [f32; 3],
screen_pos_px: Option<(f32, f32)>,
},
DragMove {
raycaster: ComponentId,
renderable: ComponentId,
hit_point: [f32; 3],
delta_world: [f32; 3],
screen_pos_px: Option<(f32, f32)>,
screen_delta_px: Option<(f32, f32)>,
},
DragEnd {
raycaster: ComponentId,
renderable: ComponentId,
hit_point: Option<[f32; 3]>,
},
Click {
raycaster: ComponentId,
renderable: ComponentId,
hit_point: [f32; 3],
screen_pos_px: Option<(f32, f32)>,
},
SelectionChanged {
selection_root: ComponentId,
mode: SelectionMode,
selected_entries: Vec<SelectionEntry>,
selected_component: Option<ComponentId>,
selected_payload: Option<ComponentId>,
},
SelectionAdded {
selection_root: ComponentId,
entry: SelectionEntry,
},
SelectionRemoved {
selection_root: ComponentId,
entry: SelectionEntry,
},
SelectionCleared {
selection_root: ComponentId,
},
Scrolling {
scroll_component: ComponentId,
drag_scope: ComponentId,
delta_world: [f32; 3],
scroll_offset: f32,
max_scroll: f32,
viewport_height: f32,
content_height: f32,
},
TextInputFocusChanged {
old: Option<ComponentId>,
new: Option<ComponentId>,
},
TextInputChanged {
component_id: ComponentId,
text: String,
caret: usize,
},
LayoutRootSizeAvailable {
layout_id: ComponentId,
width_wu: f32,
height_wu: f32,
},
DataEvent {
name: String,
payload: Option<ComponentId>,
},
XrButtonDown {
source_component: ComponentId,
hand: ControllerHand,
control: XrButtonControl,
value: f32,
},
XrButtonUp {
source_component: ComponentId,
hand: ControllerHand,
control: XrButtonControl,
value: f32,
},
XrButtonChanged {
source_component: ComponentId,
hand: ControllerHand,
control: XrButtonControl,
value: f32,
},
XrAxisChanged {
source_component: ComponentId,
hand: ControllerHand,
control: XrAxisControl,
value: [f32; 2],
},
HttpRequest {
request_id: u64,
method: String,
path: String,
query: Option<String>,
url: String,
headers: Vec<(String, String)>,
body_text: String,
remote_addr: Option<String>,
},
HttpResponse {
request_id: u64,
status: u16,
ok: bool,
headers: Vec<(String, String)>,
body_text: String,
url: String,
},
HttpError {
request_id: Option<u64>,
phase: String,
message: String,
url: Option<String>,
bind_addr: Option<String>,
},
}Expand description
Event signal: a fact/observation.
Variants§
ParentChanged
Topology changed.
RayIntersected
A raycast intersected a renderable.
CollisionStarted
Two collision objects began overlapping this tick.
delta is the vector from a to b in world space: pos(b) - pos(a).
CollisionEnded
Two collision objects stopped overlapping this tick.
delta is the last known vector from a to b in world space: pos(b) - pos(a).
DragStart
A drag gesture started.
Fields
raycaster: ComponentIdrenderable: ComponentIdDragMove
A drag gesture moved this tick.
delta_world is the world-space movement since the last DragMove for this gesture.
DragEnd
A drag gesture ended.
Click
A click: a drag gesture that ended close to where it started.
Emitted by GestureSystem at DragEnd time when the net pointer displacement is below
the click threshold (8 px screen-space, or 0.02 world units for non-screen pointers).
All intermediate DragMove events are still emitted; Click fires in addition to
DragEnd, on the same scope (the hit renderable at press time).
Payload mirrors DragStart — the thing clicked is what was under the pointer at press.
SelectionChanged
A selection scope changed.
Fields
selection_root: ComponentIdmode: SelectionModeselected_entries: Vec<SelectionEntry>selected_component: Option<ComponentId>selected_payload: Option<ComponentId>SelectionAdded
An entry was added to a selection scope.
SelectionRemoved
An entry was removed from a selection scope.
SelectionCleared
A selection scope was cleared.
Fields
selection_root: ComponentIdScrolling
A scrolling component consumed drag motion and updated its offset.
Scoped to the ScrollingComponent so downstream systems can subscribe to scroll state
changes through the scroll owner rather than the ancestor drag-capture surface.
TextInputFocusChanged
TextInputChanged
LayoutRootSizeAvailable
A LayoutComponent subtree finished layout and its computed size is now
available in world units. Scoped to the LayoutComponent’s ComponentId.
DataEvent
A named data event for cross-subtree communication.
The name identifies the event kind (e.g. “asset_selected”, “tool_selected”).
The scope on the Signal envelope identifies the shared ancestor on which
handlers are registered. payload is an optional ComponentId reference.
XrButtonDown
XrButtonUp
XrButtonChanged
XrAxisChanged
HttpRequest
Fields
HttpResponse
Fields
HttpError
Implementations§
Source§impl EventSignal
impl EventSignal
pub fn kind(&self) -> SignalKind
Trait Implementations§
Source§impl Clone for EventSignal
impl Clone for EventSignal
Source§fn clone(&self) -> EventSignal
fn clone(&self) -> EventSignal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for EventSignal
impl RefUnwindSafe for EventSignal
impl Send for EventSignal
impl Sync for EventSignal
impl Unpin for EventSignal
impl UnsafeUnpin for EventSignal
impl UnwindSafe for EventSignal
Blanket Implementations§
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<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>. 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.