Skip to content

Instantly share code, notes, and snippets.

@MortimerGoro
Last active April 19, 2017 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MortimerGoro/e06b6b5e9625cc98a7aa467ca5afeb67 to your computer and use it in GitHub Desktop.
Save MortimerGoro/e06b6b5e9625cc98a7aa467ca5afeb67 to your computer and use it in GitHub Desktop.
pub trait VRGamepad {
fn id(&self) -> u32;
// Constant data for the gamepad.
fn data(&self) -> VRGamepadData;
// Data that should be polled every frame.
fn state(&self) -> VRGamepadState;
}
pub struct VRGamepadState {
pub connected: bool,
pub timestamp: f64,
pub axes: Vec<f64>,
pub buttons: Vec<VRGamepadButton>,
pub pose: VRPose
}
pub struct VRGamepadData {
pub display_id: u32,
pub name: String,
pub hand: VRGamepadHand
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment