Only limit negative z velocity by gravity instead of total negative z velocity

This commit is contained in:
Imbris 2020-11-11 03:50:02 -05:00
parent c8357842af
commit ba042c76c8
2 changed files with 4 additions and 1 deletions

View File

@ -80,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed a bug where the closest item would be picked up instead of a selected item.
- Fixed a bug where camera zoom in and zoom out distance didn't match.
- Fixed a bug where a nearby item would also be collected when collecting collectible blocks
- Fixed a bug where firing fast projectile at a downwards angle caused them to veer off at a higher angle
## [0.7.0] - 2020-08-15

View File

@ -41,7 +41,9 @@ fn integrate_forces(dt: f32, mut lv: Vec3<f32>, grav: f32, damp: f32) -> Vec3<f3
// must be interpolated accordingly
let linear_damp = (1.0 - damp.min(1.0)).powf(dt * 60.0);
lv.z = (lv.z - grav * dt).max(-80.0);
// TODO: investigate if we can have air friction provide the neccessary limits
// here
lv.z = (lv.z - grav * dt).max(-80.0).min(lv.z);
lv * linear_damp
}