mirror of
https://github.com/minetest/minetest.git
synced 2025-03-28 05:02:35 +01:00
Remove redundant CollisionInfo::plane
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user