#include "TransformationStack.hpp"

TSE::TransformationStack::TransformationStack()
{
    stack.push_back(Matrix4x4::Identity());
}

const TSE::Matrix4x4 &TSE::TransformationStack::Top() const
{
    return stack.back();
}

void TSE::TransformationStack::Push(const Matrix4x4 &matrix)
{
    stack.push_back(Top() * matrix);
}

void TSE::TransformationStack::Pop()
{
    if (stack.size() > 1)
    {
        stack.pop_back();
    }
}
