Smoother movements/rotations when using arrow keys
This commit is contained in:
parent
3371fa42da
commit
648060f4ec
1 changed files with 6 additions and 6 deletions
|
@ -845,7 +845,7 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt)
|
||||||
selection.start_dragging();
|
selection.start_dragging();
|
||||||
start_dragging();
|
start_dragging();
|
||||||
selection.translate(displacement);
|
selection.translate(displacement);
|
||||||
wxGetApp().obj_manipul()->set_dirty();
|
// wxGetApp().obj_manipul()->set_dirty();
|
||||||
processed = true;
|
processed = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -860,19 +860,19 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt)
|
||||||
}
|
}
|
||||||
else if (m_current == Rotate)
|
else if (m_current == Rotate)
|
||||||
{
|
{
|
||||||
auto do_rotate = [this, &processed](const Vec3d& rotation) {
|
auto do_rotate = [this, &processed](double angle_z_rad) {
|
||||||
Selection& selection = m_parent.get_selection();
|
Selection& selection = m_parent.get_selection();
|
||||||
selection.start_dragging();
|
selection.start_dragging();
|
||||||
start_dragging();
|
start_dragging();
|
||||||
selection.rotate(rotation, TransformationType(TransformationType::World_Relative_Joint));
|
selection.rotate(Vec3d(0.0, 0.0, angle_z_rad), TransformationType(TransformationType::World_Relative_Joint));
|
||||||
wxGetApp().obj_manipul()->set_dirty();
|
// wxGetApp().obj_manipul()->set_dirty();
|
||||||
processed = true;
|
processed = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (keyCode)
|
switch (keyCode)
|
||||||
{
|
{
|
||||||
case WXK_NUMPAD_LEFT: case WXK_LEFT: { do_rotate(Vec3d(0.0, 0.0, 0.25 * M_PI)); break; }
|
case WXK_NUMPAD_LEFT: case WXK_LEFT: { do_rotate(0.25 * M_PI); break; }
|
||||||
case WXK_NUMPAD_RIGHT: case WXK_RIGHT: { do_rotate(-Vec3d(0.0, 0.0, 0.25 * M_PI)); break; }
|
case WXK_NUMPAD_RIGHT: case WXK_RIGHT: { do_rotate(-0.25 * M_PI); break; }
|
||||||
default: { break; }
|
default: { break; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue