wip gameplay_style

This commit is contained in:
Quaternions 2024-08-29 17:23:13 -07:00
parent d9a95e9284
commit b8714fbbc8

View File

@ -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)=>{