1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-22 20:35:24 +02:00

Remove unused pos_max_d

This commit is contained in:
sfan5
2024-11-11 19:46:02 +01:00
parent 9a44d835d6
commit c00129360e
11 changed files with 29 additions and 79 deletions

View File

@@ -209,7 +209,7 @@ bool LocalPlayer::updateSneakNode(Map *map, const v3f &position,
return true;
}
void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
void LocalPlayer::move(f32 dtime, Environment *env,
std::vector<CollisionInfo> *collision_info)
{
// Node at feet position, update each ClientEnvironment::step()
@@ -218,7 +218,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
// Temporary option for old move code
if (!physics_override.new_move) {
old_move(dtime, env, pos_max_d, collision_info);
old_move(dtime, env, collision_info);
return;
}
@@ -320,17 +320,6 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
nodemgr->get(node2.getContent()).climbable) && !free_move;
}
/*
Collision uncertainty radius
Make it a bit larger than the maximum distance of movement
*/
//f32 d = pos_max_d * 1.1;
// A fairly large value in here makes moving smoother
f32 d = 0.15f * BS;
// This should always apply, otherwise there are glitches
sanity_check(d > pos_max_d);
// Player object property step height is multiplied by BS in
// /src/script/common/c_content.cpp and /src/content_sao.cpp
float player_stepheight = (m_cao == nullptr) ? 0.0f :
@@ -341,7 +330,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
const v3f initial_speed = m_speed;
collisionMoveResult result = collisionMoveSimple(env, m_client,
pos_max_d, m_collisionbox, player_stepheight, dtime,
m_collisionbox, player_stepheight, dtime,
&position, &m_speed, accel_f, m_cao);
bool could_sneak = control.sneak && !free_move && !in_liquid &&
@@ -528,12 +517,12 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
m_can_jump = m_can_jump && jumpspeed != 0.0f;
// Autojump
handleAutojump(dtime, env, result, initial_position, initial_speed, pos_max_d);
handleAutojump(dtime, env, result, initial_position, initial_speed);
}
void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d)
void LocalPlayer::move(f32 dtime, Environment *env)
{
move(dtime, env, pos_max_d, NULL);
move(dtime, env, nullptr);
}
void LocalPlayer::applyControl(float dtime, Environment *env)
@@ -827,7 +816,7 @@ void LocalPlayer::accelerate(const v3f &target_speed, const f32 max_increase_H,
}
// Temporary option for old move code
void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
void LocalPlayer::old_move(f32 dtime, Environment *env,
std::vector<CollisionInfo> *collision_info)
{
Map *map = &env->getMap();
@@ -924,15 +913,6 @@ void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
is_climbing = (nodemgr->get(node.getContent()).climbable ||
nodemgr->get(node2.getContent()).climbable) && !free_move;
/*
Collision uncertainty radius
Make it a bit larger than the maximum distance of movement
*/
//f32 d = pos_max_d * 1.1;
// A fairly large value in here makes moving smoother
f32 d = 0.15f * BS;
// This should always apply, otherwise there are glitches
sanity_check(d > pos_max_d);
// Maximum distance over border for sneaking
f32 sneak_max = BS * 0.4f;
@@ -971,7 +951,7 @@ void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
const v3f initial_speed = m_speed;
collisionMoveResult result = collisionMoveSimple(env, m_client,
pos_max_d, m_collisionbox, player_stepheight, dtime,
m_collisionbox, player_stepheight, dtime,
&position, &m_speed, accel_f, m_cao);
// Position was slightly changed; update standing node pos
@@ -1155,7 +1135,7 @@ void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
}
// Autojump
handleAutojump(dtime, env, result, initial_position, initial_speed, pos_max_d);
handleAutojump(dtime, env, result, initial_position, initial_speed);
}
float LocalPlayer::getSlipFactor(Environment *env, const v3f &speedH)
@@ -1178,8 +1158,7 @@ float LocalPlayer::getSlipFactor(Environment *env, const v3f &speedH)
}
void LocalPlayer::handleAutojump(f32 dtime, Environment *env,
const collisionMoveResult &result, const v3f &initial_position,
const v3f &initial_speed, f32 pos_max_d)
const collisionMoveResult &result, v3f initial_position, v3f initial_speed)
{
PlayerSettings &player_settings = getPlayerSettings();
if (!player_settings.autojump)
@@ -1235,7 +1214,7 @@ void LocalPlayer::handleAutojump(f32 dtime, Environment *env,
v3f jump_speed = initial_speed;
// try at peak of jump, zero step height
collisionMoveResult jump_result = collisionMoveSimple(env, m_client, pos_max_d,
collisionMoveResult jump_result = collisionMoveSimple(env, m_client,
m_collisionbox, 0.0f, dtime, &jump_pos, &jump_speed, v3f(0.0f), m_cao);
// see if we can get a little bit farther horizontally if we had