fixed assert

This commit is contained in:
Mikulas Florek 2023-10-18 18:36:16 +02:00
parent da79ebf048
commit a95bde4687
2 changed files with 3 additions and 3 deletions

View File

@ -1185,7 +1185,7 @@ struct AssetBrowserImpl : AssetBrowser {
static TextFilter filter;
filter.gui("Filter", width, focus);
float h = ImGui::GetContentRegionAvail().y - ImGui::GetTextLineHeightWithSpacing() * 2;
float h = maximum(200.f, ImGui::GetContentRegionAvail().y - ImGui::GetTextLineHeightWithSpacing() * 2);
ImGui::BeginChild("Resources", ImVec2(0, h), false, ImGuiWindowFlags_HorizontalScrollbar);
AssetCompiler& compiler = m_app.getAssetCompiler();

View File

@ -2919,9 +2919,9 @@ struct ModelPlugin final : AssetBrowser::IPlugin, AssetCompiler::IPlugin {
}
}
const float radius = length(aabb.max - aabb.min) * 0.50001f;
const float radius = maximum(1e-5f, length(aabb.max - aabb.min) * 0.50001f);
const Vec3 center = (aabb.max + aabb.min) * 0.5f;
const Vec3 eye = center + Vec3(1, 1, 1) * length(aabb.max - aabb.min) / SQRT2;
const Vec3 eye = center + Vec3(1, 1, 1) * maximum(1e-5f, length(aabb.max - aabb.min)) / SQRT2;
Matrix mtx;
mtx.lookAt(eye, center, normalize(Vec3(1, -1, 1)));
Viewport viewport;