Remove redundant CollisionInfo::plane

This commit is contained in:
sfan5 2024-11-08 15:03:48 +01:00
parent f916f5de78
commit 9a44d835d6
3 changed files with 3 additions and 7 deletions

@ -1196,7 +1196,7 @@ void LocalPlayer::handleAutojump(f32 dtime, Environment *env,
bool horizontal_collision = false;
for (const auto &colinfo : result.collisions) {
if (colinfo.type == COLLISION_NODE && colinfo.plane != 1) {
if (colinfo.type == COLLISION_NODE && colinfo.axis != COLLISION_AXIS_Y) {
horizontal_collision = true;
break; // one is enough
}

@ -509,7 +509,6 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
info.object = nearest_info.obj;
info.new_pos = *pos_f;
info.old_speed = *speed_f;
info.plane = nearest_collided;
// Set the speed component that caused the collision to zero
if (step_up) {

@ -12,13 +12,13 @@ class IGameDef;
class Environment;
class ActiveObject;
enum CollisionType
enum CollisionType : u8
{
COLLISION_NODE,
COLLISION_OBJECT,
};
enum CollisionAxis
enum CollisionAxis : s8
{
COLLISION_AXIS_NONE = -1,
COLLISION_AXIS_X,
@ -37,9 +37,6 @@ struct CollisionInfo
v3f new_pos;
v3f old_speed;
v3f new_speed;
// FIXME: this is equivalent to `axis`, why does it exist?
int plane = -1;
};
struct collisionMoveResult