Fixed imgui error caused by merge

This commit is contained in:
Diren D Bharwani 2023-03-04 13:50:10 +08:00
parent 15bbf6892f
commit a691d2ff28
1 changed files with 50 additions and 52 deletions

View File

@ -338,7 +338,7 @@ namespace SHADE
ImGui::PushID(SHFamilyID<SHComponent>::GetID<SHColliderComponent>());
std::vector<const char*> collisionTagNames(SHCollisionTag::NUM_LAYERS);
//Fetch tag names
for (int i{}; i < SHCollisionTag::NUM_LAYERS; ++i)
for(int i{}; i < SHCollisionTag::NUM_LAYERS; ++i)
{
collisionTagNames[i] = SHCollisionTagMatrix::GetTagName(i).c_str();
}
@ -387,20 +387,20 @@ namespace SHADE
else if (shape->GetType() == SHCollisionShape::Type::CAPSULE)
{
//}
}
{
SHEditorWidgets::CheckBox("Is Trigger", [shape] { return shape->IsTrigger(); }, [shape](bool value) { shape->SetIsTrigger(value); });
SHEditorWidgets::ComboBox("Tag", collisionTagNames, [shape] {return SHCollisionTagMatrix::GetTagIndex(shape->GetCollisionTag().GetName()); }, [shape](int const& value) {shape->SetCollisionTag(SHCollisionTagMatrix::GetTag(value)); });
SHEditorWidgets::ComboBox("Tag", collisionTagNames, [shape]{return SHCollisionTagMatrix::GetTagIndex(shape->GetCollisionTag().GetName());}, [shape](int const& value){shape->SetCollisionTag(SHCollisionTagMatrix::GetTag(value));});
if (ImGui::CollapsingHeader("Physics Material"))
if(ImGui::CollapsingHeader("Physics Material"))
{
SHEditorWidgets::DragFloat("Friction", [shape] { return shape->GetFriction(); }, [shape](float value) { shape->SetFriction(value); }, "Friction", 0.05f, 0.0f, 1.0f);
SHEditorWidgets::DragFloat("Bounciness", [shape] { return shape->GetBounciness(); }, [shape](float value) { shape->SetBounciness(value); }, "Bounciness", 0.05f, 0.0f, 1.0f);
SHEditorWidgets::DragFloat("Mass Density", [shape] { return shape->GetDensity(); }, [shape](float value) { shape->SetDensity(value); }, "Mass Density", 0.1f, 0.0f);
}
SHEditorWidgets::BeginPanel("Offsets", { ImGui::GetContentRegionAvail().x, 30.0f });
SHEditorWidgets::BeginPanel("Offsets",{ ImGui::GetContentRegionAvail().x, 30.0f });
SHEditorWidgets::DragVec3("Position", { "X", "Y", "Z" }, [&shape] {return shape->GetPositionOffset(); }, [&shape](SHVec3 const& vec) {shape->SetPositionOffset(vec); });
SHEditorWidgets::DragVec3("Rotation", { "X", "Y", "Z" },
[&shape]
@ -448,12 +448,10 @@ namespace SHADE
ImGui::EndMenu();
}
}
}
else
{
DrawContextMenu(component);
}
ImGui::PopID();
}