Remove unused prev_pos in box edge checking
parent
b150b3ad38
commit
15bb9c84ae
|
@ -196,7 +196,7 @@ bool check_on_ground(Entity_t* p_ent, Vector2 pos, Vector2 prev_pos, Vector2 bbo
|
|||
|
||||
uint8_t check_bbox_edges(
|
||||
TileGrid_t* tilemap,
|
||||
Entity_t* p_ent, Vector2 pos, Vector2 prev_pos, Vector2 bbox,
|
||||
Entity_t* p_ent, Vector2 pos, Vector2 bbox,
|
||||
bool ignore_fragile
|
||||
)
|
||||
{
|
||||
|
|
|
@ -61,5 +61,5 @@ uint8_t check_collision(const CollideEntity_t* ent, TileGrid_t* grid, bool check
|
|||
uint8_t check_collision_line(const CollideEntity_t* ent, TileGrid_t* grid, bool check_oneway);
|
||||
uint8_t check_collision_offset(Entity_t* p_ent, Vector2 pos, Vector2 bbox_sz, TileGrid_t* grid, Vector2 offset);
|
||||
bool check_on_ground(Entity_t* p_ent, Vector2 pos, Vector2 prev_pos, Vector2 bbox_sz, TileGrid_t* grid);
|
||||
uint8_t check_bbox_edges(TileGrid_t* tilemap, Entity_t* p_ent, Vector2 pos, Vector2 prev_pos, Vector2 bbox, bool ignore_fragile);
|
||||
uint8_t check_bbox_edges(TileGrid_t* tilemap, Entity_t* p_ent, Vector2 pos, Vector2 bbox, bool ignore_fragile);
|
||||
#endif // __COLLISION_FUNCS_H
|
||||
|
|
|
@ -581,7 +581,7 @@ void player_crushing_system(Scene_t* scene)
|
|||
|
||||
uint8_t edges = check_bbox_edges(
|
||||
&data->tilemap, p_player,
|
||||
p_ctransform->position, p_ctransform->prev_position, p_bbox->size, true
|
||||
p_ctransform->position, p_bbox->size, true
|
||||
);
|
||||
|
||||
// There is a second check for to ensure that there is an solid entity/tile overlapping the player bbox
|
||||
|
@ -815,7 +815,7 @@ void edge_velocity_check_system(Scene_t* scene)
|
|||
// Post movement edge check to zero out velocity
|
||||
uint8_t edges = check_bbox_edges(
|
||||
&data->tilemap, p_ent,
|
||||
p_ctransform->position, p_ctransform->prev_position, p_bbox->size, false
|
||||
p_ctransform->position, p_bbox->size, false
|
||||
);
|
||||
if (edges & (1<<3))
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ void global_external_forces_system(Scene_t* scene)
|
|||
// Zero out acceleration for contacts with sturdy entites and tiles
|
||||
uint8_t edges = check_bbox_edges(
|
||||
&data->tilemap, p_ent,
|
||||
p_ctransform->position, p_ctransform->prev_position, p_bbox->size, false
|
||||
p_ctransform->position, p_bbox->size, false
|
||||
);
|
||||
if (edges & (1<<3))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue