#include "FreeLook.h"

auto FreeLook::onEnabled() -> void {
	get = true;
}

auto FreeLook::onViewPerspectiveBefore(int* perspective) -> void {
	static bool resetted = false;

	if (enabled) {
		*perspective = 1;
		resetted = false;
	}
	else {
		if (!resetted) {
			*perspective = 0;
			resetted = true;
		}
	}
}

auto FreeLook::onCameraComponentUpdate(glm::vec4* angle) -> void {
	if (!enabled) return;

	if (get) {
		lastangle = *angle;
		get = false;
	}

	*angle = lastangle;
}
