Skip to content

Commit

Permalink
VOXEDIT: disable guizmo translation
Browse files Browse the repository at this point in the history
  • Loading branch information
mgerhardy committed Jul 8, 2023
1 parent a55e1e1 commit 53044ec
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/tools/voxedit/modules/voxedit-ui/Viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,14 +586,20 @@ bool Viewport::renderSceneAndModelGizmo(const video::Camera &camera) {
return false;
}

const glm::vec3 &shift = region.getLowerCornerf();
localMatrix = glm::translate(localMatrix, shift);
bool shiftRegionBoundaries = false; // TODO: make this an option
if (shiftRegionBoundaries) {
const glm::vec3 &shift = region.getLowerCornerf();
localMatrix = glm::translate(localMatrix, shift);
}
const bool manipulated = ImGuizmo::Manipulate(
glm::value_ptr(camera.viewMatrix()), glm::value_ptr(camera.projectionMatrix()), (ImGuizmo::OPERATION)operation,
ImGuizmo::MODE::LOCAL, glm::value_ptr(localMatrix), glm::value_ptr(deltaMatrix),
_gizmoSnap->boolVal() ? snap : nullptr, bounds ? glm::value_ptr(_bounds.mins) : nullptr, boundsSnap);
if (sceneMode) {
localMatrix = glm::translate(localMatrix, -shift);
if (shiftRegionBoundaries) {
const glm::vec3 &shift = region.getLowerCornerf();
localMatrix = glm::translate(localMatrix, -shift);
}
handleGizmo(node, keyFrameIdx, localMatrix);

if (!_gizmoActivated && node.type() == scenegraph::SceneGraphNodeType::Model &&
Expand Down

0 comments on commit 53044ec

Please sign in to comment.