#ifndef SHADER_MATRIX_H
#define SHADER_MATRIX_H

#include "math/MatrixStack.h"
#include "math/Quaternion.h"
#include "math/Vector.h"
#include "rendering/Shader.h"

class ShaderMatrix final {
    Shader* shader;
    MatrixStack<16>& stack;
    Matrix* view;

public:
    ShaderMatrix(Shader* shader, MatrixStack<16>& stack, Matrix* view);
    ShaderMatrix& operator=(ShaderMatrix&& other);

    void pop();
    void push();

    ShaderMatrix& update();
    ShaderMatrix& update(const Vector3& pos, const Quaternion& rotation);

    ShaderMatrix& scale(float sx, float sy, float sz);
    ShaderMatrix& scale(float s);

    ShaderMatrix& translate(float tx, float ty, float tz);
    ShaderMatrix& translateX(float tx);
    ShaderMatrix& translateY(float ty);
    ShaderMatrix& translateZ(float tz);
    ShaderMatrix& translateTo(float tx, float ty, float tz);

    ShaderMatrix& rotateX(float degrees);
    ShaderMatrix& rotateY(float degrees);
    ShaderMatrix& rotateZ(float degrees);

    ShaderMatrix& identity();
};

#endif