|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <base/primitive.hpp>
|
|
|
|
|
#include <subface/simple/plane.hpp>
|
|
|
|
|
#include <subface/simple/cylinder_face.hpp>
|
|
|
|
|
|
|
|
|
|
namespace internal
|
|
|
|
|
{
|
|
|
|
|
struct cylinder_t final : public primitive {
|
|
|
|
|
cylinder_t(primitive_data_center_t *data_center_ptr) : primitive(data_center_ptr)
|
|
|
|
|
{
|
|
|
|
|
initialize({identity_model_matrix_ptr, plane_to_z_model_matrix_ptr, plane_to_z_pos_1_model_matrix_ptr},
|
|
|
|
|
{false, true, false},
|
|
|
|
|
k_aabb_up_unit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
primitive_type get_type() const override { return PRIMITIVE_TYPE_CYLINDER; };
|
|
|
|
|
|
|
|
|
|
span<marked_subface_ptr_t<subface>> get_subfaces() const override
|
|
|
|
|
{
|
|
|
|
|
return {const_cast<marked_subface_ptr_t<subface> *>(subfaces.data()), subfaces.size()};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stl_vector_mp<surface_type> get_subface_types() const override
|
|
|
|
|
{
|
|
|
|
|
return {surface_type::cylinder, surface_type::plane, surface_type::plane};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::array<marked_subface_ptr_t<subface>, 3> subfaces{};
|
|
|
|
|
};
|
|
|
|
|
} // namespace internal
|