Skip to content

Commit

Permalink
VOXEDIT: don't allow to shift groups in edit mode
Browse files Browse the repository at this point in the history
see issue vengi-voxel#276 for details
  • Loading branch information
mgerhardy committed Apr 19, 2023
1 parent c08f316 commit ce039f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tools/voxedit/modules/voxedit-ui/Viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "io/FileStream.h"
#include "io/Filesystem.h"
#include "math/Ray.h"
#include "scenegraph/SceneGraphNode.h"
#include "ui/IMGUIApp.h"
#include "ui/IMGUIEx.h"
#include "ui/ScopedStyle.h"
Expand Down Expand Up @@ -529,13 +530,18 @@ void Viewport::handleGizmo(const scenegraph::SceneGraphNode &node, scenegraph::K
}

bool Viewport::renderSceneAndModelGizmo(const video::Camera &camera) {
const bool sceneMode = _renderContext.sceneMode;
const scenegraph::SceneGraph &sceneGraph = sceneMgr().sceneGraph();
const int activeNode = sceneGraph.activeNode();
if (activeNode == -1) {
reset();
return false;
}
const scenegraph::SceneGraphNode &node = sceneGraph.node(activeNode);
if (!sceneMode && node.type() != scenegraph::SceneGraphNodeType::Model) {
reset();
return false;
}

const float step = core::Var::getSafe(cfg::VoxEditGridsize)->floatVal();
const float snap[]{step, step, step};
Expand All @@ -548,7 +554,6 @@ bool Viewport::renderSceneAndModelGizmo(const video::Camera &camera) {
glm::mat4 localMatrix(1.0f);
int operation = ImGuizmo::TRANSLATE;
bool bounds = false;
const bool sceneMode = _renderContext.sceneMode;
if (sceneMode) {
operation |= ImGuizmo::BOUNDS | ImGuizmo::SCALE;
if (_gizmoRotation->boolVal()) {
Expand Down

0 comments on commit ce039f8

Please sign in to comment.