Selection now works for all gizmos

This commit is contained in:
antopilo
2025-04-14 17:43:54 -04:00
parent 1af791293d
commit b8bedd6cb2
2 changed files with 3 additions and 2 deletions

View File

@@ -135,6 +135,7 @@ PSOutput main(PSInput input)
else
{
output.oEntityID = float4(0, 0, 0, 0); // Or leave it unassigned if default is zero
discard;
}
}
}

View File

@@ -257,7 +257,7 @@ void DrawIconGizmo(DebugCmd& debugCmd, const std::string& icon, const EditorCont
gizmoTransform = glm::inverse(scene->GetCurrentCamera()->GetTransform());
gizmoTransform[3] = initialTransform[3];
gizmoTransform = glm::scale(gizmoTransform, gizmoSize * GetGizmoScale(cameraPosition, initialTransform[3]));
debugCmd.DrawTexturedQuad(proj * view * gizmoTransform, TextureManager::Get()->GetTexture2(icon), isSelected ? Color(1, 1, 0, 1) : Color(1, 1, 1, 1));
debugCmd.DrawTexturedQuad(proj * view * gizmoTransform, TextureManager::Get()->GetTexture2(icon), isSelected ? Engine::GetProject()->Settings.PrimaryColor : Color(1, 1, 1, 1), (int32_t)e);
}
}
@@ -471,7 +471,7 @@ void ViewportWidget::OnDebugDraw(DebugCmd& debugCmd)
}
// Billboard + scaling logic
drawGizmoIcon(transform, texturePath, isSelected ? Color(1, 1, 0, 1) : Color(1, 1, 1, 1), (int32_t)e);
drawGizmoIcon(transform, texturePath, isSelected ? Engine::GetProject()->Settings.PrimaryColor : Color(1, 1, 1, 1), (int32_t)e);
}
DrawIconGizmo<CameraComponent>(debugCmd, "Resources/Gizmos/Camera.png", editorContext);