mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-09 20:08:57 +03:00
Changed alpha of gizmo wireframes to 0.5f and fixed viewport selection
This commit is contained in:
@@ -35,7 +35,7 @@ GizmoDrawer::GizmoDrawer()
|
||||
GenerateSphereGizmo();
|
||||
|
||||
// Box
|
||||
const Color cubeColor = Color(1, 0, 0, 1);
|
||||
const Color cubeColor = Color(1, 0, 0, 0.5f);
|
||||
std::vector<LineVertex> mBoxVertices =
|
||||
{
|
||||
LineVertex{Vector3(-1.f, -1.f, -1.f), cubeColor},
|
||||
@@ -110,8 +110,8 @@ void GizmoDrawer::GenerateSphereGizmo()
|
||||
vert2 = Vector3(x2, 0, z2);
|
||||
}
|
||||
|
||||
circleVertices.push_back(LineVertex{ vert1, Color(1.0, 0, 0.0, 1.0) });
|
||||
circleVertices.push_back(LineVertex{ vert2, Color(1.0, 0, 0.0, 1.0) });
|
||||
circleVertices.push_back(LineVertex{ vert1, Color(1.0, 0, 0.0, 0.5) });
|
||||
circleVertices.push_back(LineVertex{ vert2, Color(1.0, 0, 0.0, 0.5) });
|
||||
}
|
||||
|
||||
mCircleBuffer = CreateRef<Nuake::VertexArray>();
|
||||
|
||||
@@ -62,8 +62,8 @@ void CapsuleGizmo::CreateMesh()
|
||||
vert2 = Vector3(x2, bottomCircleHeight, z2);
|
||||
}
|
||||
|
||||
_CapsuleVertices.push_back(LineVertex{ vert1, Color(1.0, 0, 0.0, 1.0) });
|
||||
_CapsuleVertices.push_back(LineVertex{ vert2, Color(1.0, 0, 0.0, 1.0) });
|
||||
_CapsuleVertices.push_back(LineVertex{ vert1, Color(1.0, 0, 0.0, 0.5) });
|
||||
_CapsuleVertices.push_back(LineVertex{ vert2, Color(1.0, 0, 0.0, 0.5) });
|
||||
}
|
||||
|
||||
for (int i = 0; i < subDivision * 2.0; i++)
|
||||
@@ -94,21 +94,21 @@ void CapsuleGizmo::CreateMesh()
|
||||
vert2 = Vector3(0, z2 + heightOffset, x2);
|
||||
}
|
||||
|
||||
_CapsuleVertices.push_back(LineVertex{ vert1, Color(1.0, 0, 0.0, 1.0) });
|
||||
_CapsuleVertices.push_back(LineVertex{ vert2, Color(1.0, 0, 0.0, 1.0) });
|
||||
_CapsuleVertices.push_back(LineVertex{ vert1, Color(1.0, 0, 0.0, 0.5) });
|
||||
_CapsuleVertices.push_back(LineVertex{ vert2, Color(1.0, 0, 0.0, 0.5) });
|
||||
}
|
||||
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(radius, bottomCircleHeight, 0), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(radius, topCircleHeight, 0), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(radius, bottomCircleHeight, 0), Color(1.0, 0, 0.0, 0.5) });
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(radius, topCircleHeight, 0), Color(1.0, 0, 0.0, 0.5) });
|
||||
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(-radius, bottomCircleHeight, 0), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(-radius, topCircleHeight, 0), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(-radius, bottomCircleHeight, 0), Color(1.0, 0, 0.0, 0.5) });
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(-radius, topCircleHeight, 0), Color(1.0, 0, 0.0, 0.5) });
|
||||
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(0, bottomCircleHeight, radius), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(0, topCircleHeight, radius), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(0, bottomCircleHeight, radius), Color(1.0, 0, 0.0, 0.5) });
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(0, topCircleHeight, radius), Color(1.0, 0, 0.0, 0.5) });
|
||||
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(0, bottomCircleHeight, -radius), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(0, topCircleHeight, -radius), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(0, bottomCircleHeight, -radius), Color(1.0, 0, 0.0, 0.5) });
|
||||
_CapsuleVertices.push_back(LineVertex{ Vector3(0, topCircleHeight, -radius), Color(1.0, 0, 0.0, 0.5) });
|
||||
|
||||
_CapsuleBuffer = CreateRef<Nuake::VertexArray>();
|
||||
_CapsuleBuffer->Bind();
|
||||
|
||||
@@ -62,21 +62,21 @@ void CylinderGizmo::CreateMesh()
|
||||
vert2 = Vector3(x2, bottomCircleHeight, z2);
|
||||
}
|
||||
|
||||
_CylinderVertices.push_back(LineVertex{ vert1, Color(1.0, 0, 0.0, 1.0) });
|
||||
_CylinderVertices.push_back(LineVertex{ vert2, Color(1.0, 0, 0.0, 1.0) });
|
||||
_CylinderVertices.push_back(LineVertex{ vert1, Color(1.0, 0, 0.0, 0.5) });
|
||||
_CylinderVertices.push_back(LineVertex{ vert2, Color(1.0, 0, 0.0, 0.5) });
|
||||
}
|
||||
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(radius, bottomCircleHeight, 0), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(radius, topCircleHeight, 0), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(radius, bottomCircleHeight, 0), Color(1.0, 0, 0.0, 0.5) });
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(radius, topCircleHeight, 0), Color(1.0, 0, 0.0, 0.5) });
|
||||
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(-radius, bottomCircleHeight, 0), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(-radius, topCircleHeight, 0), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(-radius, bottomCircleHeight, 0), Color(1.0, 0, 0.0, 0.5) });
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(-radius, topCircleHeight, 0), Color(1.0, 0, 0.0, 0.5) });
|
||||
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(0, bottomCircleHeight, radius), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(0, topCircleHeight, radius), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(0, bottomCircleHeight, radius), Color(1.0, 0, 0.0, 0.5) });
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(0, topCircleHeight, radius), Color(1.0, 0, 0.0, 0.5) });
|
||||
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(0, bottomCircleHeight, -radius), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(0, topCircleHeight, -radius), Color(1.0, 0, 0.0, 1.0) });
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(0, bottomCircleHeight, -radius), Color(1.0, 0, 0.0, 0.5) });
|
||||
_CylinderVertices.push_back(LineVertex{ Vector3(0, topCircleHeight, -radius), Color(1.0, 0, 0.0, 0.5) });
|
||||
|
||||
_CylinderBuffer = CreateRef<Nuake::VertexArray>();
|
||||
_CylinderBuffer->Bind();
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace Nuake {
|
||||
}
|
||||
|
||||
m_IsViewportFocused = ImGui::IsWindowFocused();
|
||||
if (m_IsHoveringViewport && Input::IsMouseButtonPressed(GLFW_MOUSE_BUTTON_2) && !ImGuizmo::IsUsing())
|
||||
if (m_IsHoveringViewport && Input::IsMouseButtonPressed(GLFW_MOUSE_BUTTON_1) && !ImGuizmo::IsUsing())
|
||||
{
|
||||
ImGui::FocusWindow(ImGui::GetCurrentWindow());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user