#include <freeCam.h>

void FreeCam::pre_render() {
    if (engine->window->isKeyDown(Keys::W))
        move(getAngleDirection(), 4);

    if (engine->window->isKeyDown(Keys::S))
        move(bAngle(), 4);

    if (engine->window->isKeyDown(Keys::A))
        move(lAngle(), 4);

    if (engine->window->isKeyDown(Keys::D))
        move(rAngle(), 4);

    if (engine->window->isKeyDown(Keys::Space))
        vMove(4);

    if (engine->window->isKeyDown(Keys::LShift))
        vMove(-4);

    if (engine->window->isKeyDown(Keys::LeftArrow))
        setAngle(getAngle().x, getAngle().y - 75.0f * engine->frameDelta, getAngle().z);

    if (engine->window->isKeyDown(Keys::RightArrow))
        setAngle(getAngle().x, getAngle().y + 75.0f * engine->frameDelta, getAngle().z);

    if (engine->window->isKeyDown(Keys::UpArrow))
        setAngle(getAngle().x - 75.0f * engine->frameDelta, getAngle().y, getAngle().z);

    if (engine->window->isKeyDown(Keys::DownArrow))
        setAngle(getAngle().x + 75.0f * engine->frameDelta, getAngle().y, getAngle().z);
    
    if (engine->window->isKeyDown(Keys::Q))
        setAngle(getAngle().x, getAngle().y, getAngle().z - 75.0f * engine->frameDelta);

    if (engine->window->isKeyDown(Keys::E))
        setAngle(getAngle().x, getAngle().y, getAngle().z + 75.0f * engine->frameDelta);

}
