#include <pw/core/vector.hpp>
#include <pw/core/serialize.hpp>
#include <pw/core/matrix_transform.hpp>
#include <pw/core/mesh.hpp>
#include <pw/core/axisangle.hpp>

#include <iostream>

int main(int argc,char **argv) {

    pw::geometry amesh;

    pw::geometry::vertex3array_t vs = { {-1,-1,0},{1,-1,0},{0,1,0} };
    amesh.set_vertices(vs);

    for (auto v : amesh.vertices()) {
        std::cout << pw::serialize::matrix(v.transposed()) << std::endl;
    }

    auto scale = pw::matrix_transform<float>::scale_matrix({2,2,2});

    amesh.apply(scale);

    std::cout << "after scale" << std::endl;

    for (auto v : amesh.vertices()) {
        std::cout << pw::serialize::matrix(v.transposed()) << std::endl;
    }

    pw::axisangle aa;

    aa.axis = pw::vector3({ 0, 0, 1 });
    aa.angle = pw::deg_to_rad(90.0f);

    auto rot_mat = aa.to_matrix();

    amesh.apply(rot_mat);

    std::cout << "after rotate" << std::endl;

    for (auto v : amesh.vertices()) {
        std::cout << pw::serialize::matrix(v.transposed()) << std::endl;
    }



}
