pub struct InteractionInput {
pub pair: Option<(u64, u64)>,
pub held: bool,
pub in_range: bool,
pub focused: bool,
pub permitted: bool,
pub visible: bool,
}Expand description
A host-supplied snapshot of the conditions for one actor/target pair.
pair is (actor, target). All gates must be true to advance a hold. Range
and visibility are supplied as booleans so this rule does not duplicate the
host’s geometry queries. focused means gameplay input is enabled for this
actor; suppressing local input must not stop authoritative simulation ticks.
The default has no target and all gates closed.
use ferravex_play::gameplay::interaction::{Interaction, InteractionInput};
let input = InteractionInput {
pair: Some((1, 2)), held: true, in_range: true, focused: true,
permitted: true, visible: true,
};
let interaction = Interaction::new(1.0).unwrap();
assert_eq!(interaction.eligibility(input), Ok(()));
assert_eq!(interaction.progress(), 0.0);Fields§
§pair: Option<(u64, u64)>The actor and target, or None when no interaction target is selected.
held: boolWhether the interaction button is currently held.
in_range: boolWhether the actor is within the target’s interaction range.
focused: boolWhether gameplay input for this actor has focus.
permitted: boolWhether the actor is allowed to perform the interaction.
visible: boolWhether required line of sight is clear.
Trait Implementations§
Source§impl Clone for InteractionInput
impl Clone for InteractionInput
Source§fn clone(&self) -> InteractionInput
fn clone(&self) -> InteractionInput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InteractionInput
impl Debug for InteractionInput
Source§impl Default for InteractionInput
impl Default for InteractionInput
Source§fn default() -> InteractionInput
fn default() -> InteractionInput
Returns the “default value” for a type. Read more
Source§impl PartialEq for InteractionInput
impl PartialEq for InteractionInput
impl Copy for InteractionInput
impl Eq for InteractionInput
impl StructuralPartialEq for InteractionInput
Auto Trait Implementations§
impl Freeze for InteractionInput
impl RefUnwindSafe for InteractionInput
impl Send for InteractionInput
impl Sync for InteractionInput
impl Unpin for InteractionInput
impl UnwindSafe for InteractionInput
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
Mutably borrows from an owned value. Read more