less gravity in space

This commit is contained in:
darkrose 2016-01-25 13:20:52 +10:00
parent 609112acdb
commit df075a7e94
2 changed files with 8 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 861 B

After

Width:  |  Height:  |  Size: 871 B

View File

@ -3745,15 +3745,20 @@ void ClientEnvironment::step(float dtime)
{ {
// Apply physics // Apply physics
if (lplayer->control.free == false && is_climbing == false) { if (lplayer->control.free == false && is_climbing == false) {
bool space = (lplayer->getPosition().Y > 1000*BS);
// Gravity // Gravity
v3f speed = lplayer->getSpeed(); v3f speed = lplayer->getSpeed();
if (lplayer->swimming_up == false) if (lplayer->swimming_up == false) {
speed.Y -= 9.81 * BS * dtime_part * 2; float pull = 9.81;
if (space)
pull = 1.0;
speed.Y -= (pull*BS)*(dtime_part*2);
}
// Water resistance // Water resistance
if (lplayer->in_water_stable || lplayer->in_water) { if (lplayer->in_water_stable || lplayer->in_water) {
f32 max_down = 2.0*BS; f32 max_down = 2.0*BS;
if (speed.Y < -max_down) if (!space && speed.Y < -max_down)
speed.Y = -max_down; speed.Y = -max_down;
f32 max = 2.5*BS; f32 max = 2.5*BS;