mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-15 07:32:39 -07:00
Fixed rotation of single instance -> it works now with absolute values.
Added Absolute / relative, World / Local, Rigid body / independent modifier parameter to the object / group rotation.
This commit is contained in:
@@ -361,16 +361,20 @@ void ObjectManipulation::change_rotation_value(const Vec3d& rotation)
|
||||
GLCanvas3D* canvas = wxGetApp().plater()->canvas3D();
|
||||
const GLCanvas3D::Selection& selection = canvas->get_selection();
|
||||
|
||||
Vec3d delta_rotation = rotation - m_cache.rotation;
|
||||
GLCanvas3D::TransformationType transformation_type(GLCanvas3D::TransformationType::World_Relative_Joint);
|
||||
if (selection.is_single_full_instance() || selection.requires_local_axes())
|
||||
transformation_type.set_independent();
|
||||
if (selection.is_single_full_instance()) {
|
||||
transformation_type.set_absolute();
|
||||
transformation_type.set_local();
|
||||
}
|
||||
|
||||
Vec3d rad_rotation;
|
||||
for (size_t i = 0; i < 3; ++i)
|
||||
{
|
||||
rad_rotation(i) = Geometry::deg2rad(delta_rotation(i));
|
||||
}
|
||||
rad_rotation(i) = Geometry::deg2rad((transformation_type.absolute()) ? rotation(i) : rotation(i) - m_cache.rotation(i));
|
||||
|
||||
canvas->get_selection().start_dragging();
|
||||
canvas->get_selection().rotate(rad_rotation, selection.is_single_full_instance() || selection.requires_local_axes());
|
||||
canvas->get_selection().rotate(rad_rotation, transformation_type);
|
||||
canvas->do_rotate();
|
||||
|
||||
m_cache.rotation = rotation;
|
||||
|
||||
Reference in New Issue
Block a user