mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-09-13 11:43:15 +08:00
Restored previous behavior when moving node in scene
Signed-off-by: Arthur Brainville (Ybalrid) <ybalrid@ybalrid.info>
This commit is contained in:
parent
df9003ea08
commit
e832baf229
@ -340,7 +340,7 @@ void mouseMoveCallback(float x, float y) {
|
|||||||
if (gMouseLeftDown) {
|
if (gMouseLeftDown) {
|
||||||
if (ImGuizmo::IsOver() || ImGuizmo::IsUsing()) {
|
if (ImGuizmo::IsOver() || ImGuizmo::IsUsing()) {
|
||||||
gSceneDirty = true;
|
gSceneDirty = true;
|
||||||
RequestRender();
|
// RequestRender();
|
||||||
} else {
|
} else {
|
||||||
float w = static_cast<float>(gRenderConfig.width);
|
float w = static_cast<float>(gRenderConfig.width);
|
||||||
float h = static_cast<float>(gRenderConfig.height);
|
float h = static_cast<float>(gRenderConfig.height);
|
||||||
@ -360,8 +360,6 @@ void mouseMoveCallback(float x, float y) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Adjust y.
|
// Adjust y.
|
||||||
std::cout << "trackball in mouseMoveCallback\nmouseDown "
|
|
||||||
<< gMouseLeftDown << '\n';
|
|
||||||
trackball(gPrevQuat, (2.f * gMousePosX - w) / (float)w,
|
trackball(gPrevQuat, (2.f * gMousePosX - w) / (float)w,
|
||||||
(h - 2.f * (gMousePosY - y_offset)) / (float)h,
|
(h - 2.f * (gMousePosY - y_offset)) / (float)h,
|
||||||
(2.f * x - w) / (float)w,
|
(2.f * x - w) / (float)w,
|
||||||
@ -386,10 +384,13 @@ void mouseButtonCallback(int button, int state, float x, float y) {
|
|||||||
|
|
||||||
ImGuiIO &io = ImGui::GetIO();
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
if (io.WantCaptureMouse || io.WantCaptureKeyboard) {
|
if (io.WantCaptureMouse || io.WantCaptureKeyboard) {
|
||||||
std::cout << "muse or keyboard used by imgui\n";
|
if (button == 0 && !state) {
|
||||||
return;
|
if (ImGuizmo::IsUsing()) {
|
||||||
|
gSceneDirty = true;
|
||||||
|
RequestRender();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
// left button
|
// left button
|
||||||
if (button == 0) {
|
if (button == 0) {
|
||||||
if (state) {
|
if (state) {
|
||||||
@ -399,9 +400,6 @@ void mouseButtonCallback(int button, int state, float x, float y) {
|
|||||||
trackball(gPrevQuat, 0.0f, 0.0f, 0.0f, 0.0f);
|
trackball(gPrevQuat, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ImGuizmo::IsOver() || ImGuizmo::IsUsing()) {
|
|
||||||
gSceneDirty = true;
|
|
||||||
RequestRender();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user