You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.5 KiB
40 lines
1.5 KiB
|
2 weeks ago
|
#pragma once
|
||
|
|
|
||
|
|
#include <base/primitive.hpp>
|
||
|
|
#include <subface/simple/plane.hpp>
|
||
|
|
|
||
|
|
namespace internal
|
||
|
|
{
|
||
|
|
struct box_t final : public primitive {
|
||
|
|
box_t(primitive_data_center_t *data_center_ptr) : primitive(data_center_ptr)
|
||
|
|
{
|
||
|
|
initialize({trans_by_target_axis_matrices_ptr<model_matrix::axis::x, true, 1>,
|
||
|
|
trans_by_target_axis_matrices_ptr<model_matrix::axis::x, false, 1>,
|
||
|
|
trans_by_target_axis_matrices_ptr<model_matrix::axis::y, true, 1>,
|
||
|
|
trans_by_target_axis_matrices_ptr<model_matrix::axis::y, false, 1>,
|
||
|
|
trans_by_target_axis_matrices_ptr<model_matrix::axis::z, true, 1>,
|
||
|
|
trans_by_target_axis_matrices_ptr<model_matrix::axis::z, false, 1>},
|
||
|
|
{{}, {}, {}, {}, {}, {}},
|
||
|
|
k_aabb_unit);
|
||
|
|
}
|
||
|
|
|
||
|
|
primitive_type get_type() const override { return PRIMITIVE_TYPE_BOX; };
|
||
|
|
|
||
|
|
span<marked_subface_ptr_t<subface>> get_subfaces() const override
|
||
|
|
{
|
||
|
|
return {const_cast<marked_subface_ptr_t<subface> *>(subfaces.data()), subfaces.size()};
|
||
|
|
}
|
||
|
|
|
||
|
|
std::vector<surface_type> get_subface_types() const override
|
||
|
|
{
|
||
|
|
return {surface_type::plane,
|
||
|
|
surface_type::plane,
|
||
|
|
surface_type::plane,
|
||
|
|
surface_type::plane,
|
||
|
|
surface_type::plane,
|
||
|
|
surface_type::plane};
|
||
|
|
}
|
||
|
|
|
||
|
|
std::array<marked_subface_ptr_t<subface>, 6> subfaces{};
|
||
|
|
};
|
||
|
|
} // namespace internal
|