From fee06aea0f6dca77d099e40c651a48ab2c71ab9d Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 21 Feb 2024 22:42:37 -0800 Subject: [PATCH] fly in style --- src/gameplay_style.rs | 48 ++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/src/gameplay_style.rs b/src/gameplay_style.rs index 3e6fda0..1a1c08c 100644 --- a/src/gameplay_style.rs +++ b/src/gameplay_style.rs @@ -3,33 +3,41 @@ const VALVE_SCALE:Planar64=Planar64::raw(1<<28);// 1/16 use crate::integer::{Time,Ratio64,Planar64,Planar64Vec3}; use crate::controls_bitflag::Controls; +#[derive(Clone,Debug)] +pub enum Continuity{ + FirstDegree(FlySettings), + SecondDegree{ + //strafing + strafe:Option, + //player gets a controllable rocket force + rocket:Option, + //flying + //jumping is allowed + jump:Option, + //standing & walking is allowed + walk:Option, + //laddering is allowed + ladder:Option, + //water propulsion + swim:Option, + //maximum slope before sloped surfaces become frictionless + gravity:Planar64Vec3, + //unused + mass:Planar64, + } +} + #[derive(Clone,Debug)] pub struct StyleModifiers{ //controls which are allowed to pass into gameplay (usually all) pub controls_mask:Controls, //controls which are masked from control state (e.g. !jump in scroll style) pub controls_mask_state:Controls, - //strafing - pub strafe:Option, - //player gets a controllable rocket force - pub rocket:Option, - //flying - //jumping is allowed - pub jump:Option, - //standing & walking is allowed - pub walk:Option, - //laddering is allowed - pub ladder:Option, - //water propulsion - pub swim:Option, - //maximum slope before sloped surfaces become frictionless - pub gravity:Planar64Vec3, + pub continuity:Continuity, //hitbox pub hitbox:Hitbox, //camera location relative to the center (0,0,0) of the hitbox pub camera_offset:Planar64Vec3, - //unused - pub mass:Planar64, } impl std::default::Default for StyleModifiers{ fn default()->Self{ @@ -37,6 +45,12 @@ impl std::default::Default for StyleModifiers{ } } +#[derive(Clone,Debug)] +pub struct FlySettings{ + speed:Planar64, + clip:bool,//noclip +} + #[derive(Clone,Debug)] pub enum JumpCalculation{ Capped,//roblox