Renamed collision function.
This commit is contained in:
parent
edbedae703
commit
78cfb78a5a
|
|
@ -34,7 +34,7 @@ int physics_system_init(component_t *component)
|
||||||
|
|
||||||
// Only for this file
|
// Only for this file
|
||||||
// Args : physics_system_data_t *system_data, size_t entity_id
|
// Args : physics_system_data_t *system_data, size_t entity_id
|
||||||
static inline int action_check_hitboxes(elem_t *elem, va_list args)
|
static inline int action_detect_solve_entities_collision(elem_t *elem, va_list args)
|
||||||
{
|
{
|
||||||
const entity_t *target_entity = elem->data;
|
const entity_t *target_entity = elem->data;
|
||||||
physics_system_data_t *system_data = va_arg(args, physics_system_data_t *);
|
physics_system_data_t *system_data = va_arg(args, physics_system_data_t *);
|
||||||
|
|
@ -103,7 +103,7 @@ int physics_system_update(component_t *component)
|
||||||
system_data->velocity.x = lerp(system_data->velocity.x, system_data->target_velocity.x, system_data->smoothing_factor);
|
system_data->velocity.x = lerp(system_data->velocity.x, system_data->target_velocity.x, system_data->smoothing_factor);
|
||||||
system_data->velocity.y = lerp(system_data->velocity.y, system_data->target_velocity.y, system_data->smoothing_factor);
|
system_data->velocity.y = lerp(system_data->velocity.y, system_data->target_velocity.y, system_data->smoothing_factor);
|
||||||
|
|
||||||
linked_list_for_each(&game.entity_manager.entities, action_check_hitboxes, system_data, component->entity->id);
|
linked_list_for_each(&game.entity_manager.entities, action_detect_solve_entities_collision, system_data, component->entity->id);
|
||||||
|
|
||||||
transform_component_data->bounds.x += system_data->velocity.x * system_data->speed * (float)game.delta_time_ms / 1000.0f;
|
transform_component_data->bounds.x += system_data->velocity.x * system_data->speed * (float)game.delta_time_ms / 1000.0f;
|
||||||
transform_component_data->bounds.y += system_data->velocity.y * system_data->speed * (float)game.delta_time_ms / 1000.0f;
|
transform_component_data->bounds.y += system_data->velocity.y * system_data->speed * (float)game.delta_time_ms / 1000.0f;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue