#include "component_control_aim.h"

/* DEPENDENCIES: Physics */

/* Ticks control_aim component. Sets facing angle to that of the mouse. */
void
component_control_aim_tick(ComponentControlAim* self, ECS* ecs)
{
	ComponentPhysics* physics;
	f32 angle;
	vec2 position;

	physics = ecs_component_get(ecs, ECS_COMPONENT_PHYSICS, self->component.id);

	physics->angle = mouse_angle_from_world_position_get
	(
		&ecs->game->input.mouse,
		&ecs->game->renderer,
		physics->position
	);
}
