Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions ImGuizmo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ namespace IMGUIZMO_NAMESPACE

//
int mCurrentOperation;
int mHoveredOperation;
Comment thread
KismetPartisan marked this conversation as resolved.
Outdated

float mX = 0.f;
float mY = 0.f;
Expand Down Expand Up @@ -1033,19 +1034,21 @@ namespace IMGUIZMO_NAMESPACE

bool IsOver(OPERATION op)
{
if(IsUsing())
{
return true;
}
if(Intersects(op, SCALE) && GetScaleType(op) != MT_NONE)
{
return true;
}
if(Intersects(op, ROTATE) && GetRotateType(op) != MT_NONE)
{
return true;
}
if(Intersects(op, TRANSLATE) && GetMoveType(op, NULL) != MT_NONE)
int hoveredOperation = gContext.mHoveredOperation;
if(gContext.mHoveredOperation == 3)
Comment thread
KismetPartisan marked this conversation as resolved.
Outdated
hoveredOperation = 4;
else if(gContext.mHoveredOperation == 4)
hoveredOperation = 6;
else if(gContext.mHoveredOperation == 6)
hoveredOperation = 3;
else if(gContext.mHoveredOperation > 8 && gContext.mHoveredOperation < 15)
hoveredOperation = std::pow(2, gContext.mHoveredOperation - 5);
else if(gContext.mHoveredOperation == 15)
hoveredOperation = SCALE_X | SCALE_Y | SCALE_Z;
if(gContext.mHoveredOperation > 11 && Intersects(gContext.mOperation, SCALEU))
hoveredOperation *= 16;

if(op & hoveredOperation)
{
return true;
}
Expand Down Expand Up @@ -2236,6 +2239,7 @@ namespace IMGUIZMO_NAMESPACE
// find new possible way to move
vec_t gizmoHitProportion;
type = gContext.mbOverGizmoHotspot ? MT_NONE : GetMoveType(op, &gizmoHitProportion);
if(!gContext.mbOverGizmoHotspot) gContext.mHoveredOperation = type;
gContext.mbOverGizmoHotspot |= type != MT_NONE;
if (type != MT_NONE)
{
Expand Down Expand Up @@ -2286,6 +2290,7 @@ namespace IMGUIZMO_NAMESPACE
{
// find new possible way to scale
type = gContext.mbOverGizmoHotspot ? MT_NONE : GetScaleType(op);
if(!gContext.mbOverGizmoHotspot) gContext.mHoveredOperation = type;
gContext.mbOverGizmoHotspot |= type != MT_NONE;

if (type != MT_NONE)
Expand Down Expand Up @@ -2409,6 +2414,7 @@ namespace IMGUIZMO_NAMESPACE
if (!gContext.mbUsing)
{
type = gContext.mbOverGizmoHotspot ? MT_NONE : GetRotateType(op);
if(!gContext.mbOverGizmoHotspot) gContext.mHoveredOperation = type;
gContext.mbOverGizmoHotspot |= type != MT_NONE;

if (type != MT_NONE)
Expand Down