Skip to content
Snippets Groups Projects
Commit e4b44e63 authored by Philip Trettner's avatar Philip Trettner
Browse files

Merge branch 'feature/update-libraries' into 'develop'

Feature/update libraries

See merge request !20
parents 951cdb26 f1cf3cdc
Branches
No related tags found
1 merge request!20Feature/update libraries
Pipeline #25220 passed
Subproject commit 4f0b6bf78a006db89b098cf80160b98e35f08b2e
Subproject commit 7448833e5e3fae448b8635f45dfc261c8d13b6ed
Subproject commit 3eaf1255b29fdf5c2895856c7be7d7185ef2b241
Subproject commit b35641f4a3c62aa86a0b3c983d163bc0fe36026d
glow @ 02406b84
Subproject commit 5c8b4f9169a622117b22c42d2925cb4fc3be9358
Subproject commit 02406b84db80d923691ce2fc2641c235f894fe63
glow-extras @ d203b2a6
Subproject commit 89472844133cbf2b352e5ecbf0f7cce037ac817d
Subproject commit d203b2a68c0228d5c3691fc23e525174955e4f2f
imgui @ e777b78e
Subproject commit 440ba209b1794c54699fd6c62be984c4f5fd6a5f
Subproject commit e777b78e287d1e9cfaece582629edcc272f24779
Subproject commit 67d9890922fc75332f917bdded27a48bf47d592e
Subproject commit 1657f19ea1dd1d69a5f8abcfbd36d72b3bf3c892
Subproject commit 177f00c451942d7798d8985415f93d6f7e376e22
Subproject commit 3ebf5e741ef40a7b5919f16f56b05d834564cb0f
Subproject commit 5886d159d801960cea93a1c88017013a9ff6640e
Subproject commit 073a6b075f89597d6e0b362cf96c087321d4d913
Subproject commit c5e3b1482a4d35cc3c7b4f4a5a61050dfee627eb
Subproject commit 31bbb63b8a1af5a2ec41a51533b0f6b2c56525a8
......@@ -198,11 +198,11 @@ void imguizmo(pm::vertex_attribute<tg::pos3> const& pos)
// an interactive view is required
gv::interactive([&](float) {
// you can define keybindings to select an operation
if (ImGui::IsKeyPressed(GLFW_KEY_T))
if (ImGui::IsKeyPressed(ImGuiKey(GLFW_KEY_T)))
currentGizmoOperation = ImGuizmo::TRANSLATE;
if (ImGui::IsKeyPressed(GLFW_KEY_R))
if (ImGui::IsKeyPressed(ImGuiKey(GLFW_KEY_R)))
currentGizmoOperation = ImGuizmo::ROTATE;
if (ImGui::IsKeyPressed(GLFW_KEY_S))
if (ImGui::IsKeyPressed(ImGuiKey(GLFW_KEY_S)))
currentGizmoOperation = ImGuizmo::SCALE;
// you can also choose the correct operation using gui elements
......@@ -239,7 +239,7 @@ void imguizmo(pm::vertex_attribute<tg::pos3> const& pos)
}
// toggle snap on p key
if (ImGui::IsKeyPressed(GLFW_KEY_P))
if (ImGui::IsKeyPressed(ImGuiKey(GLFW_KEY_P)))
useSnap = !useSnap;
// ... or use gui elements
......@@ -1336,7 +1336,7 @@ void subtle_cases(pm::vertex_attribute<tg::pos3> const& pos)
gv::view(pos, tg::scaling(2.0, 2.0, 2.0), "double transform");
}
void known_issues(pm::vertex_attribute<tg::pos3> const&)
void known_issues(pm::vertex_attribute<tg::pos3> const& pos)
{
pm::Mesh mLine;
const auto v0 = mLine.vertices().add();
......@@ -1362,6 +1362,52 @@ void known_issues(pm::vertex_attribute<tg::pos3> const&)
// Screen space camera facing lines seem fine
// gv::view(gv::lines(line).line_width_px(250.0f).camera_facing(), lineColors, tg::translation(0.0f, 0.0f, -25.f));
}
// when using a custom camera, the given initial transform will be overwritten by the viewer which causes unintiuitiv behaviour
// a workaround it to initialize the camera in the second frame
{
auto cam_0 = gv::CameraController::create();
auto cam_1 = gv::CameraController::create();
// the following lines will be ignored as the camera will be initialized after the first call to the interactive lambda and in turn overwriting the camera transform
// cam_0->setTransform({0,0,2}, {0,0,0});
// cam_0->clipCamera();
// cam_1->setTransform({0,0,-2}, {0,0,0});
// cam_1->clipCamera();
auto r0 = gv::make_renderable(pos);
auto r1 = gv::make_renderable(pos);
auto frames = 2;
gv::interactive([&](){
auto g = gv::grid();
{
auto v = gv::view();
v.configure(cam_0);
gv::view(r0);
}
{
auto v = gv::view();
v.configure(cam_1);
gv::view(r1);
}
// re-initializing the camera after the first frame will fix the issue
if(frames > 0)
{
cam_0->setTransform({0,0,2}, {0,0,0});
cam_0->clipCamera();
cam_1->setTransform({0,0,-2}, {0,0,0});
cam_1->clipCamera();
--frames;
}
});
}
}
int main()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment