From a967f310049358f2d43239073db03e9b041a3d02 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 8 Jan 2025 01:15:45 -0800 Subject: [PATCH] rename RawTime to AbsoluteTime --- lib/common/src/gameplay_attributes.rs | 8 ++++---- lib/common/src/gameplay_style.rs | 14 +++++++------- lib/common/src/integer.rs | 6 ++---- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/lib/common/src/gameplay_attributes.rs b/lib/common/src/gameplay_attributes.rs index 09fd1e4..79dae16 100644 --- a/lib/common/src/gameplay_attributes.rs +++ b/lib/common/src/gameplay_attributes.rs @@ -1,5 +1,5 @@ use crate::model; -use crate::integer::{RawTime,Planar64,Planar64Vec3}; +use crate::integer::{AbsoluteTime,Planar64,Planar64Vec3}; //you have this effect while in contact #[derive(Clone,Hash,Eq,PartialEq)] @@ -31,7 +31,7 @@ pub enum Booster{ //Affine(crate::integer::Planar64Affine3),//capable of SetVelocity,DotVelocity,normal booster,bouncy part,redirect velocity, and much more Velocity(Planar64Vec3),//straight up boost velocity adds to your current velocity Energy{direction:Planar64Vec3,energy:Planar64},//increase energy in direction - AirTime(RawTime),//increase airtime, invariant across mass and gravity changes + AirTime(AbsoluteTime),//increase airtime, invariant across mass and gravity changes Height(Planar64),//increase height, invariant across mass and gravity changes } impl Booster{ @@ -57,13 +57,13 @@ pub enum TrajectoryChoice{ #[derive(Clone,Hash,Eq,PartialEq)] pub enum SetTrajectory{ //Speed-type SetTrajectory - AirTime(RawTime),//air time (relative to gravity direction) is invariant across mass and gravity changes + AirTime(AbsoluteTime),//air time (relative to gravity direction) is invariant across mass and gravity changes Height(Planar64),//boost height (relative to gravity direction) is invariant across mass and gravity changes DotVelocity{direction:Planar64Vec3,dot:Planar64},//set your velocity in a specific direction without touching other directions //Velocity-type SetTrajectory TargetPointTime{//launch on a trajectory that will land at a target point in a set amount of time target_point:Planar64Vec3, - time:RawTime,//short time = fast and direct, long time = launch high in the air, negative time = wrong way + time:AbsoluteTime,//short time = fast and direct, long time = launch high in the air, negative time = wrong way }, TargetPointSpeed{//launch at a fixed speed and land at a target point target_point:Planar64Vec3, diff --git a/lib/common/src/gameplay_style.rs b/lib/common/src/gameplay_style.rs index 26a323a..60d7fb4 100644 --- a/lib/common/src/gameplay_style.rs +++ b/lib/common/src/gameplay_style.rs @@ -1,6 +1,6 @@ const VALVE_SCALE:Planar64=Planar64::raw(1<<28);// 1/16 -use crate::integer::{int,vec3::int as int3,RawTime,Ratio64,Planar64,Planar64Vec3}; +use crate::integer::{int,vec3::int as int3,AbsoluteTime,Ratio64,Planar64,Planar64Vec3}; use crate::controls_bitflag::Controls; use crate::physics::Time as PhysicsTime; @@ -49,7 +49,7 @@ pub enum JumpCalculation{ #[derive(Clone,Debug)] pub enum JumpImpulse{ - Time(RawTime),//jump time is invariant across mass and gravity changes + Time(AbsoluteTime),//jump time is invariant across mass and gravity changes Height(Planar64),//jump height is invariant across mass and gravity changes Linear(Planar64),//jump velocity is invariant across mass and gravity changes Energy(Planar64),// :) @@ -436,7 +436,7 @@ impl StyleModifiers{ enable:ControlsActivation::full_2d(), air_accel_limit:None, mv:int(3), - tick_rate:Ratio64::new(64,RawTime::ONE_SECOND.get() as u64).unwrap(), + tick_rate:Ratio64::new(64,AbsoluteTime::ONE_SECOND.get() as u64).unwrap(), }), jump:Some(JumpSettings{ impulse:JumpImpulse::Energy(int(512)), @@ -478,10 +478,10 @@ impl StyleModifiers{ enable:ControlsActivation::full_2d(), air_accel_limit:None, mv:int(27)/10, - tick_rate:Ratio64::new(100,RawTime::ONE_SECOND.get() as u64).unwrap(), + tick_rate:Ratio64::new(100,AbsoluteTime::ONE_SECOND.get() as u64).unwrap(), }), jump:Some(JumpSettings{ - impulse:JumpImpulse::Time(RawTime::from_micros(715_588)), + impulse:JumpImpulse::Time(AbsoluteTime::from_micros(715_588)), calculation:JumpCalculation::Max, limit_minimum:true, }), @@ -535,7 +535,7 @@ impl StyleModifiers{ enable:ControlsActivation::full_2d(), air_accel_limit:Some(Planar64::raw(150<<28)*100), mv:(Planar64::raw(30)*VALVE_SCALE).fix_1(), - tick_rate:Ratio64::new(100,RawTime::ONE_SECOND.get() as u64).unwrap(), + tick_rate:Ratio64::new(100,AbsoluteTime::ONE_SECOND.get() as u64).unwrap(), }), jump:Some(JumpSettings{ impulse:JumpImpulse::Height((int(52)*VALVE_SCALE).fix_1()), @@ -576,7 +576,7 @@ impl StyleModifiers{ enable:ControlsActivation::full_2d(), air_accel_limit:Some((int(150)*66*VALVE_SCALE).fix_1()), mv:(int(30)*VALVE_SCALE).fix_1(), - tick_rate:Ratio64::new(66,RawTime::ONE_SECOND.get() as u64).unwrap(), + tick_rate:Ratio64::new(66,AbsoluteTime::ONE_SECOND.get() as u64).unwrap(), }), jump:Some(JumpSettings{ impulse:JumpImpulse::Height((int(52)*VALVE_SCALE).fix_1()), diff --git a/lib/common/src/integer.rs b/lib/common/src/integer.rs index 6d4d69f..b557d85 100644 --- a/lib/common/src/integer.rs +++ b/lib/common/src/integer.rs @@ -6,7 +6,7 @@ pub use ratio_ops::ratio::{Ratio,Divide}; /// specific example of a "default" time type #[derive(Clone,Copy,Hash,Eq,PartialEq,PartialOrd,Debug)] pub enum TimeInner{} -pub type RawTime=Time; +pub type AbsoluteTime=Time; #[derive(Clone,Copy,Hash,Eq,PartialEq,PartialOrd,Debug)] pub struct Time(i64,core::marker::PhantomData); @@ -148,9 +148,7 @@ impl core::ops::Mul> for Planar64{ #[cfg(test)] mod test_time{ use super::*; - #[derive(Clone,Copy,Hash,Eq,PartialEq,PartialOrd,Debug)] - struct Test; - type Time=super::Time; + type Time=super::AbsoluteTime; #[test] fn time_from_planar64(){ let a:Time=Planar64::from(1).into();