rename JumpImpulse variant
This commit is contained in:
parent
415be69ba8
commit
7d1058164b
@ -50,7 +50,7 @@ pub enum JumpCalculation{
|
||||
pub enum JumpImpulse{
|
||||
FromTime(Time),//jump time 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),// :)
|
||||
}
|
||||
//Jumping acts on dot(walks_state.normal,body.velocity)
|
||||
@ -66,7 +66,7 @@ impl JumpImpulse{
|
||||
match self{
|
||||
&JumpImpulse::FromTime(time)=>gravity.length()*(time/2),
|
||||
&JumpImpulse::FromHeight(height)=>(gravity.length()*height*2).sqrt(),
|
||||
&JumpImpulse::FromDeltaV(deltav)=>deltav,
|
||||
&JumpImpulse::FromLinear(deltav)=>deltav,
|
||||
&JumpImpulse::FromEnergy(energy)=>(energy*2/mass).sqrt(),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user