fixed physics import

This commit is contained in:
Mikulas Florek 2023-09-23 14:50:03 +02:00
parent 556273bf83
commit 742f40b817
2 changed files with 11 additions and 5 deletions

View file

@ -13,8 +13,8 @@ return {
sunlight_strength = 10,
cloud_param0 = 1,
cloud_param1 = 1,
cloud_param2 = 1,
cloud_param3 = 1,
cloud_param2 = 0.63,
cloud_param3 = 3,
enable_clouds = false,
enable_fog = false,
enable_godrays = false,
@ -23,7 +23,13 @@ return {
enabled = true,
gui = function(self)
_, self.enabled = ImGui.Checkbox("Enabled", self.enabled)
for k, v in pairs(self) do
if typeof(v) == "number" then
_, self[k] = ImGui.DragFloat(k, v)
elseif typeof(v) == "boolean" then
_, self[k] = ImGui.Checkbox(k, v)
end
end
end,
setDrawcallUniforms = function(self, env, x, y, z)

View file

@ -2063,7 +2063,7 @@ struct ModelPlugin final : AssetBrowser::IPlugin, AssetCompiler::IPlugin {
saveUndo(ImGui::InputFloat("##cull_scale", &m_meta.culling_scale));
ImGuiEx::Label("Origin");
if (ImGui::BeginCombo("##origin", ModelMeta::toString(m_meta.origin))) {
if (ImGui::BeginCombo("##origin", ModelMeta::toUIString(m_meta.origin))) {
if (ImGui::Selectable("Keep")) {
m_meta.origin = FBXImporter::ImportConfig::Origin::SOURCE;
saveUndo(true);
@ -2099,7 +2099,7 @@ struct ModelPlugin final : AssetBrowser::IPlugin, AssetCompiler::IPlugin {
saveUndo(true);
}
ImGuiEx::Label("Physics");
if (ImGui::BeginCombo("##phys", ModelMeta::toString(m_meta.physics))) {
if (ImGui::BeginCombo("##phys", ModelMeta::toUIString(m_meta.physics))) {
if (ImGui::Selectable("None")) {
m_meta.physics = FBXImporter::ImportConfig::Physics::NONE;
saveUndo(true);