#include <cstddef>
#include <iterator>
#include <pw/core/aabb.hpp>

#include <print>
#include <vector>

auto main() -> int {

    auto vertices =
        std::vector<pw::vector<float, 3>>{{-1.f, 1.f, 0},
                                          {2.f, -1.f, 3.f},
                                          {0, 0, -1.f},
                                          {-1'000.f, 2'000.f, 3'000.f}};

    auto indices = std::vector<std::size_t>{0, 1, 2};

    auto aabb_1 =
        pw::aabb<decltype(vertices)::value_type::value_type,
                 decltype(vertices)::value_type::coefficients>::make(vertices);

    std::print("aabb::min -> {} {} {}\n", aabb_1.min.x(), aabb_1.min.y(),
               aabb_1.min.z());

    std::print("aabb::max -> {} {} {}\n", aabb_1.max.x(), aabb_1.max.y(),
               aabb_1.max.z());

    auto aabb_2 = pw::aabb<decltype(vertices)::value_type::value_type,
                           decltype(vertices)::value_type::coefficients>::
        make_from_indexed_vertices(vertices, indices);

    std::print("aabb::min -> {} {} {}\n", aabb_2.min.x(), aabb_2.min.y(),
               aabb_2.min.z());

    std::print("aabb::max -> {} {} {}\n", aabb_2.max.x(), aabb_2.max.y(),
               aabb_2.max.z());
}
