19#if !defined(IMGUIZMO_IMGUI_FOLDER)
20 #define IMGUIZMO_IMGUI_FOLDER imgui/
24#define INC_PATH(X) <GET_PATH(IMGUIZMO_IMGUI_FOLDER)X>
26#define IMGUI_DEFINE_MATH_OPERATORS
28#include INC_PATH(imgui.h)
29#include INC_PATH(imgui_internal.h)
49#define imguiGizmo_INTERPOLATE_NORMALS
50#define STARTING_ALPHA_PLANE .75f
73#ifndef IMGUIZMO_USE_ONLY_ROT
115 static void buildPolygon (
const vec3& size,ImVector<vec3>& vtx,ImVector<vec3>& norm);
116 static void buildSphere (
const float radius,
const int tessFactor);
117 static void buildCone (
const float x0,
const float x1,
const float radius,
const int slices);
118 static void buildCylinder(
const float x0,
const float x1,
const float radius,
const int slices);
134 setDirectionColor(ImGui::ColorConvertU32ToFloat4(dColor), ImGui::ColorConvertU32ToFloat4(pColor)); }
146 setSphereColors( ImGui::ColorConvertFloat4ToU32(a), ImGui::ColorConvertFloat4ToU32(b)); }
160#ifndef IMGUIZMO_USE_ONLY_ROT
187 bool drawFunc(
const char* label,
float size);
197 float len = length(dir);
199 if(len<1.0 && len>= FLT_EPSILON) { normalize(dir); len = 1.0; }
200 else if(len< FLT_EPSILON) { dir =
vec3(1.f, 0.f, 0.f); len = 1.0; }
202 q = angleAxis(acosf(dir.
x/len), normalize(
vec3(FLT_EPSILON, -dir.
z, dir.
y)));
205 if (ret) dir = (q *
vec3(1.0f, 0.0f, 0.0f)) * len ;
212 q = angleAxis(axis_angle.
w,
vec3(axis_angle));
215 if (ret) axis_angle =
vec4(
vec3(axis(q)),angle(q));
303#ifndef IMGUIZMO_USE_ONLY_ROT
312#define IMGUIZMO_DEF_SIZE (ImGui::GetFrameHeightWithSpacing()*4 - (ImGui::GetStyle().ItemSpacing.y*2))
325#ifndef IMGUIZMO_USE_ONLY_ROT
#define STARTING_ALPHA_PLANE
#define IMGUIZMO_DEF_SIZE
bool gizmo3D(const char *label, quat &q, float size, const int mode)
static void resizeAxesOf(const vec3 &newSize)
static void setPanModifier(vgModifiers v)
static ImVector< vec3 > planeNorm
static void setDirectionColor(const ImVec4 &color)
static ImVector< vec3 > cubeNorm
static float getGizmoFeelingRot()
static vgModifiers dollyMod
static void restoreAxesSize()
static void setDirectionColor(ImU32 color)
void setDualMode(const int mode)
static ImU32 sphereColors[2]
static vec3 axesResizeFactor
bool getTransforms(quat &q, const char *label, vec4 &axis_angle, float size)
bool getTransforms(quat &q, const char *label, vec3 &dir, float size)
bool drawFunc(const char *label, float size)
static ImVector< vec3 > planeVtx
static ImVector< int > sphereTess
static void setDirectionColor(const ImVec4 &dColor, const ImVec4 &pColor)
static float getDollyScale()
static ImVector< vec3 > cubeVtx
static ImVec4 savedPlaneColor
static float gizmoFeelingRot
static void setPanScale(float scale)
static ImVector< vec3 > arrowNorm[4]
static ImVec4 directionColor
static ImVector< vec3 > arrowVtx[4]
static float sphereRadius
static float solidResizeFactor
static vec3 savedAxesResizeFactor
static void restoreSphereColors()
static void setSphereColors(ImU32 a, ImU32 b)
static void setDollyModifier(vgModifiers v)
static ImVector< vec3 > sphereVtx
static ImVec4 savedDirectionColor
static float planeThickness
static void restoreDirectionColor()
static float savedSolidResizeFactor
static void buildCone(const float x0, const float x1, const float radius, const int slices)
static void buildCylinder(const float x0, const float x1, const float radius, const int slices)
static void setDirectionColor(ImU32 dColor, const ImU32 pColor)
static void buildCube(const float size)
static void setGizmoFeelingRot(float f)
static ImU32 savedSphereColors[2]
static void buildSphere(const float radius, const int tessFactor)
static void buildPlane(const float size, const float thickness=planeThickness)
static bool solidAreBuilded
static void setSphereColors(const ImVec4 &a, const ImVec4 &b)
static float getPanScale()
static const int imguiGizmoDefaultSize
static void setDollyScale(float scale)
static void resizeSolidOf(float newSize)
void modeSettings(int mode)
static void restoreSolidSize()
static vgModifiers panMod
static void buildPolygon(const vec3 &size, ImVector< vec3 > &vtx, ImVector< vec3 > &norm)
static int sphereTessFactor