46void EditTransform(
const Camera& camera, matrix_t& matrix)
50 if (ImGui::IsKeyPressed(90))
52 if (ImGui::IsKeyPressed(69))
54 if (ImGui::IsKeyPressed(82))
59 if (ImGui::RadioButton(
"Rotate", mCurrentGizmoOperation ==
ImGuizmo::ROTATE))
62 if (ImGui::RadioButton(
"Scale", mCurrentGizmoOperation ==
ImGuizmo::SCALE))
64 float matrixTranslation[3], matrixRotation[3], matrixScale[3];
66 ImGui::InputFloat3(
"Tr", matrixTranslation, 3);
67 ImGui::InputFloat3(
"Rt", matrixRotation, 3);
68 ImGui::InputFloat3(
"Sc", matrixScale, 3);
79 static bool useSnap(
false);
80 if (ImGui::IsKeyPressed(83))
82 ImGui::Checkbox(
"", &useSnap);
85 switch (mCurrentGizmoOperation)
88 snap = config.mSnapTranslation;
89 ImGui::InputFloat3(
"Snap", &snap.x);
92 snap = config.mSnapRotation;
93 ImGui::InputFloat(
"Angle Snap", &snap.x);
96 snap = config.mSnapScale;
97 ImGui::InputFloat(
"Scale Snap", &snap.x);
100 ImGuiIO& io = ImGui::GetIO();
102 ImGuizmo::Manipulate(camera.mView.m16, camera.mProjection.m16, mCurrentGizmoOperation, mCurrentGizmoMode, matrix.m16, NULL, useSnap ? &snap.x : NULL);
159 IMGUI_API void DrawCubes(
const float* view,
const float* projection,
const float* matrices,
int matrixCount);
160 IMGUI_API void DrawGrid(
const float* view,
const float* projection,
const float* matrix,
const float gridSize);
186 return static_cast<OPERATION>(
static_cast<int>(lhs) |
static_cast<int>(rhs));
195 IMGUI_API bool Manipulate(
const float* view,
const float* projection,
OPERATION operation,
MODE mode,
float* matrix,
float* deltaMatrix = NULL,
const float* snap = NULL,
const float* localBounds = NULL,
const float* boundsSnap = NULL);
void SetGizmoSizeClipSpace(float value)
void SetRect(float x, float y, float width, float height)
void AllowAxisFlip(bool value)
bool Manipulate(const float *view, const float *projection, OPERATION operation, MODE mode, float *matrix, float *deltaMatrix, const float *snap, const float *localBounds, const float *boundsSnap)
void SetImGuiContext(ImGuiContext *ctx)
void SetOrthographic(bool isOrthographic)
void DrawCubes(const float *view, const float *projection, const float *matrices, int matrixCount)
void DrawGrid(const float *view, const float *projection, const float *matrix, const float gridSize)
OPERATION operator|(OPERATION lhs, OPERATION rhs)
void DecomposeMatrixToComponents(const float *matrix, float *translation, float *rotation, float *scale)
void RecomposeMatrixFromComponents(const float *translation, const float *rotation, const float *scale, float *matrix)
void SetDrawlist(ImDrawList *drawlist)
void ViewManipulate(float *view, float length, ImVec2 position, ImVec2 size, ImU32 backgroundColor)