rename JumpImpulse variant

This commit is contained in:
Quaternions 2024-08-07 14:40:59 -07:00
parent 415be69ba8
commit 7d1058164b

View File

@ -50,7 +50,7 @@ pub enum JumpCalculation{
pub enum JumpImpulse{ pub enum JumpImpulse{
FromTime(Time),//jump time is invariant across mass and gravity changes FromTime(Time),//jump time is invariant across mass and gravity changes
FromHeight(Planar64),//jump height is invariant across mass and gravity changes FromHeight(Planar64),//jump height is invariant across mass and gravity changes
FromDeltaV(Planar64),//jump velocity is invariant across mass and gravity changes FromLinear(Planar64),//jump velocity is invariant across mass and gravity changes
FromEnergy(Planar64),// :) FromEnergy(Planar64),// :)
} }
//Jumping acts on dot(walks_state.normal,body.velocity) //Jumping acts on dot(walks_state.normal,body.velocity)
@ -66,7 +66,7 @@ impl JumpImpulse{
match self{ match self{
&JumpImpulse::FromTime(time)=>gravity.length()*(time/2), &JumpImpulse::FromTime(time)=>gravity.length()*(time/2),
&JumpImpulse::FromHeight(height)=>(gravity.length()*height*2).sqrt(), &JumpImpulse::FromHeight(height)=>(gravity.length()*height*2).sqrt(),
&JumpImpulse::FromDeltaV(deltav)=>deltav, &JumpImpulse::FromLinear(deltav)=>deltav,
&JumpImpulse::FromEnergy(energy)=>(energy*2/mass).sqrt(), &JumpImpulse::FromEnergy(energy)=>(energy*2/mass).sqrt(),
} }
} }