#include "component_action_point_to_mouse.h"

/* DEPENDENCIES: Sprite */

/* Ticks action point to mouse component. Sets facing angle to that of the mouse. */
void
component_action_point_to_mouse_tick(ComponentActionPointToMouse* self, ECS* ecs)
{
	ComponentSprite* sprite;

	sprite = ecs_component_get(ecs, ECS_COMPONENT_SPRITE, self->component.id);

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