jumped velocity
This commit is contained in:
parent
12907fa4a9
commit
d292993c16
@ -206,6 +206,18 @@ pub struct JumpSettings{
|
|||||||
//information used to calculate jump behaviour
|
//information used to calculate jump behaviour
|
||||||
calculation:JumpCalculation,
|
calculation:JumpCalculation,
|
||||||
}
|
}
|
||||||
|
impl JumpSettings{
|
||||||
|
pub fn jumped_velocity(&self,style:&StyleModifiers,jump_dir:Planar64Vec3,velocity:Planar64Vec3)->Planar64Vec3{
|
||||||
|
match self.calculation{
|
||||||
|
//roblox style
|
||||||
|
JumpCalculation::Capped=>todo!(),
|
||||||
|
//something different
|
||||||
|
JumpCalculation::Energy=>todo!(),
|
||||||
|
//source style
|
||||||
|
JumpCalculation::Linear=>velocity+jump_dir*(self.impulse.get_jump_deltav(&style.gravity,style.mass)/jump_dir.length()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct AccelerateSettings{
|
pub struct AccelerateSettings{
|
||||||
|
Loading…
Reference in New Issue
Block a user