From b070b9706fb6d25686097f19679972fdb96b962a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sun, 10 Sep 2023 14:13:24 -0700 Subject: [PATCH] InputState --- src/body.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/body.rs b/src/body.rs index f80726e..a09141d 100644 --- a/src/body.rs +++ b/src/body.rs @@ -39,6 +39,18 @@ enum InputInstruction { Jump(bool), } +struct InputState { + controls: u32, + mouse_interpolation: MouseInterpolation, + time: TIME, +} + +impl InputState { + pub fn get_control(&self,control:u32) -> bool { + self.controls&control!=0 + } +} + pub struct MouseInterpolationState { interpolation: MouseInterpolation, time0: TIME,