20 size_t item_current_idx = data.shape.index();
22 const auto& combo_preview_value = variant_types[item_current_idx];
26 if(ImGui::BeginCombo(
"##Type",
name.c_str()))
28 for(
int n = 0; n < variant_types.size(); n++)
30 const bool is_selected = (item_current_idx == n);
34 if(ImGui::Selectable(
name.c_str(), is_selected))
37 result.changed =
true;
40 result.edit_finished |= ImGui::IsItemDeactivatedAfterEdit();
43 ImGui::DrawItemActivityOutline();
47 ImGui::SetItemDefaultFocus();
51 result.edit_finished |= ImGui::IsItemDeactivatedAfterEdit();
53 ImGui::DrawItemActivityOutline();
59 const auto type = variant_types[item_current_idx];
60 if(
type == entt::resolve<physics_box_shape>())
64 else if(
type == entt::resolve<physics_sphere_shape>())
68 else if(
type == entt::resolve<physics_capsule_shape>())
72 else if(
type == entt::resolve<physics_cylinder_shape>())
78 if(hpp::holds_alternative<physics_box_shape>(data.shape))
80 auto&
shape = hpp::get<physics_box_shape>(data.shape);
83 else if(hpp::holds_alternative<physics_sphere_shape>(data.shape))
85 auto&
shape = hpp::get<physics_sphere_shape>(data.shape);
88 else if(hpp::holds_alternative<physics_capsule_shape>(data.shape))
90 auto&
shape = hpp::get<physics_capsule_shape>(data.shape);
93 else if(hpp::holds_alternative<physics_cylinder_shape>(data.shape))
95 auto&
shape = hpp::get<physics_cylinder_shape>(data.shape);
100 ImGui::LabelText(
"Unknown",
"%s",
"test");