Updated ImGuizmo.

This commit is contained in:
Branimir Karadžić 2018-05-18 21:45:26 -07:00
parent a0975b5f41
commit 54e183806b
2 changed files with 1990 additions and 1830 deletions

View File

@ -1,5 +1,5 @@
// https://github.com/CedricGuillemet/ImGuizmo
// v 1.04 WIP
// v 1.61 WIP
//
// The MIT License(MIT)
//
@ -105,18 +105,21 @@ void EditTransform(const Camera& camera, matrix_t& matrix)
namespace ImGuizmo
{
// call inside your own window and before Manipulate() in order to draw gizmo to that window.
IMGUI_API void SetDrawlist();
// call BeginFrame right after ImGui_XXXX_NewFrame();
void BeginFrame();
IMGUI_API void BeginFrame();
// return true if mouse cursor is over any gizmo control (axis, plan or screen component)
bool IsOver();
IMGUI_API bool IsOver();
// return true if mouse IsOver or if the gizmo is in moving state
bool IsUsing();
IMGUI_API bool IsUsing();
// enable/disable the gizmo. Stay in the state until next call to Enable.
// gizmo is rendered with gray half transparent color when disabled
void Enable(bool enable);
IMGUI_API void Enable(bool enable);
// helper functions for manualy editing translation/rotation/scale with an input float
// translation, rotation and scale float points to 3 floats each
@ -130,13 +133,16 @@ namespace ImGuizmo
// ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, gizmoMatrix.m16);
//
// These functions have some numerical stability issues for now. Use with caution.
void DecomposeMatrixToComponents(const float *matrix, float *translation, float *rotation, float *scale);
void RecomposeMatrixFromComponents(const float *translation, const float *rotation, const float *scale, float *matrix);
IMGUI_API void DecomposeMatrixToComponents(const float *matrix, float *translation, float *rotation, float *scale);
IMGUI_API void RecomposeMatrixFromComponents(const float *translation, const float *rotation, const float *scale, float *matrix);
void SetRect(float x, float y, float width, float height);
IMGUI_API void SetRect(float x, float y, float width, float height);
// default is false
IMGUI_API void SetOrthographic(bool isOrthographic);
// Render a cube with face color corresponding to face normal. Usefull for debug/tests
void DrawCube(const float *view, const float *projection, float *matrix);
IMGUI_API void DrawCube(const float *view, const float *projection, const float *matrix);
IMGUI_API void DrawGrid(const float *view, const float *projection, const float *matrix, const float gridSize);
// call it when you want a gizmo
// Needs view and projection matrices.
@ -147,6 +153,7 @@ namespace ImGuizmo
TRANSLATE,
ROTATE,
SCALE,
BOUNDS,
};
enum MODE
@ -155,5 +162,5 @@ namespace ImGuizmo
WORLD
};
void Manipulate(const float *view, const float *projection, OPERATION operation, MODE mode, float *matrix, float *deltaMatrix = 0, float *snap = 0, float *localBounds = NULL, float *boundsSnap = NULL);
IMGUI_API void Manipulate(const float *view, const float *projection, OPERATION operation, MODE mode, float *matrix, float *deltaMatrix = 0, float *snap = 0, float *localBounds = NULL, float *boundsSnap = NULL);
};

File diff suppressed because it is too large Load Diff