Skip to content

Commit

Permalink
Preditor: EditTools: Rename m_bWorldTransforms
Browse files Browse the repository at this point in the history
  • Loading branch information
tmp64 committed Dec 31, 2023
1 parent 6c1c486 commit 10c1f50
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Preditor/EditTools/EditToolManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EditTools::EditToolManager::EditToolManager(ISceneEditor* pEditor)
gPreditor->pInput->FindAction("transform_tools.toggle_tool_space")->AddListener([this](const KeyActionEventArgs& e)
{
if (e.isPressed)
m_bWorldTransforms ^= 1;
m_bWorldTransform ^= 1;
});

// Start with select tool
Expand All @@ -39,8 +39,8 @@ EditTools::EditToolManager::~EditToolManager()

void EditTools::EditToolManager::ShowSelectionUI()
{
if (ImGui::Button(m_bWorldTransforms ? ICON_MD_LANGUAGE : ICON_MD_VIEW_IN_AR))
m_bWorldTransforms ^= 1;
if (ImGui::Button(m_bWorldTransform ? ICON_MD_LANGUAGE : ICON_MD_VIEW_IN_AR))
m_bWorldTransform ^= 1;
ImGui::SameLine();

EditTool* tools[] = { m_pSelectTool.get(), m_pMoveTool.get(), m_pRotateTool.get(), m_pScaleTool.get() };
Expand Down
4 changes: 2 additions & 2 deletions Preditor/EditTools/EditToolManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class EditToolManager final : public IEditToolManager
EditTool* GetCurrentTool() const { return m_pCurTool; }

//! @returns whether transformation tools should tranform in the world space.
bool IsWorldTransform() const { return m_bWorldTransforms; }
bool IsWorldTransform() const { return m_bWorldTransform; }

//! Shows controls for the tool selection UI.
void ShowSelectionUI();
Expand All @@ -33,7 +33,7 @@ class EditToolManager final : public IEditToolManager
bool m_bIsActive = false;
ISceneEditor* m_pEditor = nullptr;
EditTool* m_pCurTool = nullptr;
bool m_bWorldTransforms = true;
bool m_bWorldTransform = true;

std::unique_ptr<EditTool> m_pSelectTool;
std::unique_ptr<EditTool> m_pMoveTool;
Expand Down
5 changes: 3 additions & 2 deletions Preditor/EditTools/ImGuizmoTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void EditTools::ImGuizmoTool::DrawViewport(const Vec4& bounds, const CCamera& ca
Matrix44 projMat;
FrustumFromCamera(camera, bounds.z - bounds.x, bounds.w - bounds.y, projMat.GetData());

ImGuizmo::Manipulate(
bool manipulated = ImGuizmo::Manipulate(
viewMat.GetData(),
projMat.GetData(),
m_Op,
Expand All @@ -121,7 +121,8 @@ void EditTools::ImGuizmoTool::DrawViewport(const Vec4& bounds, const CCamera& ca
nullptr, // deltaMatrix
m_pSnapKey->IsHeldDown() ? & m_Snap.x : nullptr);

pManip->SetObjectWorldTM(activeObj, Matrix34(ImGuizmoToCry(objectTM)));
if (manipulated)
pManip->SetObjectWorldTM(activeObj, Matrix34(ImGuizmoToCry(objectTM)));
}
}

Expand Down

0 comments on commit 10c1f50

Please sign in to comment.