mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Remove redundant CollisionInfo::plane
This commit is contained in:
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;
|
bool horizontal_collision = false;
|
||||||
for (const auto &colinfo : result.collisions) {
|
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;
|
horizontal_collision = true;
|
||||||
break; // one is enough
|
break; // one is enough
|
||||||
}
|
}
|
||||||
|
|
|
@ -509,7 +509,6 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
|
||||||
info.object = nearest_info.obj;
|
info.object = nearest_info.obj;
|
||||||
info.new_pos = *pos_f;
|
info.new_pos = *pos_f;
|
||||||
info.old_speed = *speed_f;
|
info.old_speed = *speed_f;
|
||||||
info.plane = nearest_collided;
|
|
||||||
|
|
||||||
// Set the speed component that caused the collision to zero
|
// Set the speed component that caused the collision to zero
|
||||||
if (step_up) {
|
if (step_up) {
|
||||||
|
|
|
@ -12,13 +12,13 @@ class IGameDef;
|
||||||
class Environment;
|
class Environment;
|
||||||
class ActiveObject;
|
class ActiveObject;
|
||||||
|
|
||||||
enum CollisionType
|
enum CollisionType : u8
|
||||||
{
|
{
|
||||||
COLLISION_NODE,
|
COLLISION_NODE,
|
||||||
COLLISION_OBJECT,
|
COLLISION_OBJECT,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CollisionAxis
|
enum CollisionAxis : s8
|
||||||
{
|
{
|
||||||
COLLISION_AXIS_NONE = -1,
|
COLLISION_AXIS_NONE = -1,
|
||||||
COLLISION_AXIS_X,
|
COLLISION_AXIS_X,
|
||||||
|
@ -37,9 +37,6 @@ struct CollisionInfo
|
||||||
v3f new_pos;
|
v3f new_pos;
|
||||||
v3f old_speed;
|
v3f old_speed;
|
||||||
v3f new_speed;
|
v3f new_speed;
|
||||||
|
|
||||||
// FIXME: this is equivalent to `axis`, why does it exist?
|
|
||||||
int plane = -1;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct collisionMoveResult
|
struct collisionMoveResult
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue