diff --git a/src/gameplay_style.rs b/src/gameplay_style.rs index c415e51..329e2db 100644 --- a/src/gameplay_style.rs +++ b/src/gameplay_style.rs @@ -1,6 +1,6 @@ const VALVE_SCALE:Planar64=Planar64::raw(1<<28);// 1/16 -use crate::integer::{Time,Ratio64,Planar64,Planar64Vec3}; +use crate::integer::{Time,Ratio64,Planar64,Planar64Vec3,WideMul,WideDot}; use crate::controls_bitflag::Controls; #[derive(Clone,Debug)] @@ -72,7 +72,7 @@ impl JumpImpulse{ let g=gravity.wide_length(); let v_g=gravity.wide_dot(velocity); //do it backwards - velocity-gravity.with_length(((v_g*v_g+g*height.widen()*2).sqrt()+v_g)/g) + velocity-gravity.with_length(((v_g.wide_mul(v_g)+g.wide_mul(height).wide_mul(2)).sqrt()+v_g).ratio(g)) }, &JumpImpulse::Linear(jump_speed)=>velocity+jump_dir.with_length(jump_speed), &JumpImpulse::Energy(energy)=>{