Tech ENABLE_TRANSFORMATIONS_BY_MATRICES merged into ENABLE_WORLD_COORDINATE
Fixed conflicts during rebase with master
This commit is contained in:
parent
f591535d20
commit
00878fb330
26 changed files with 340 additions and 897 deletions
|
@ -98,19 +98,11 @@ void GLGizmoMove3D::on_start_dragging()
|
|||
m_starting_drag_position = m_center + m_grabbers[m_hover_id].center;
|
||||
else if (coordinates_type == ECoordinatesType::Local && selection.is_single_volume_or_modifier()) {
|
||||
const GLVolume& v = *selection.get_first_volume();
|
||||
#if ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
m_starting_drag_position = m_center + v.get_instance_transformation().get_rotation_matrix() * v.get_volume_transformation().get_rotation_matrix() * m_grabbers[m_hover_id].center;
|
||||
#else
|
||||
m_starting_drag_position = m_center + Geometry::assemble_transform(Vec3d::Zero(), v.get_instance_rotation()) * Geometry::assemble_transform(Vec3d::Zero(), v.get_volume_rotation()) * m_grabbers[m_hover_id].center;
|
||||
#endif // ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
}
|
||||
else {
|
||||
const GLVolume& v = *selection.get_first_volume();
|
||||
#if ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
m_starting_drag_position = m_center + v.get_instance_transformation().get_rotation_matrix() * m_grabbers[m_hover_id].center;
|
||||
#else
|
||||
m_starting_drag_position = m_center + Geometry::assemble_transform(Vec3d::Zero(), v.get_instance_rotation()) * m_grabbers[m_hover_id].center;
|
||||
#endif // ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
}
|
||||
m_starting_box_center = m_center;
|
||||
m_starting_box_bottom_center = m_center;
|
||||
|
@ -141,7 +133,6 @@ void GLGizmoMove3D::on_dragging(const UpdateData& data)
|
|||
|
||||
Selection &selection = m_parent.get_selection();
|
||||
#if ENABLE_WORLD_COORDINATE
|
||||
#if ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
TransformationType trafo_type;
|
||||
trafo_type.set_relative();
|
||||
switch (wxGetApp().obj_manipul()->get_coordinates_type())
|
||||
|
@ -151,9 +142,6 @@ void GLGizmoMove3D::on_dragging(const UpdateData& data)
|
|||
default: { break; }
|
||||
}
|
||||
selection.translate(m_displacement, trafo_type);
|
||||
#else
|
||||
selection.translate(m_displacement, wxGetApp().obj_manipul()->get_coordinates_type());
|
||||
#endif // ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
#else
|
||||
selection.translate(m_displacement);
|
||||
#endif // ENABLE_WORLD_COORDINATE
|
||||
|
@ -529,17 +517,9 @@ Transform3d GLGizmoMove3D::local_transform(const Selection& selection) const
|
|||
Transform3d ret = Geometry::assemble_transform(m_center);
|
||||
if (!wxGetApp().obj_manipul()->is_world_coordinates()) {
|
||||
const GLVolume& v = *selection.get_first_volume();
|
||||
#if ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
Transform3d orient_matrix = v.get_instance_transformation().get_rotation_matrix();
|
||||
#else
|
||||
Transform3d orient_matrix = v.get_instance_transformation().get_matrix(true, false, true, true);
|
||||
#endif // ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
if (selection.is_single_volume_or_modifier() && wxGetApp().obj_manipul()->is_local_coordinates())
|
||||
#if ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
orient_matrix = orient_matrix * v.get_volume_transformation().get_rotation_matrix();
|
||||
#else
|
||||
orient_matrix = orient_matrix * v.get_volume_transformation().get_matrix(true, false, true, true);
|
||||
#endif // ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
ret = ret * orient_matrix;
|
||||
}
|
||||
return ret;
|
||||
|
@ -569,12 +549,8 @@ void GLGizmoMove3D::calc_selection_box_and_center()
|
|||
}
|
||||
else if (coordinates_type == ECoordinatesType::Local && selection.is_single_volume_or_modifier()) {
|
||||
const GLVolume& v = *selection.get_first_volume();
|
||||
#if ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
m_bounding_box = v.transformed_convex_hull_bounding_box(
|
||||
v.get_instance_transformation().get_scaling_factor_matrix() * v.get_volume_transformation().get_scaling_factor_matrix());
|
||||
#else
|
||||
m_bounding_box = v.transformed_convex_hull_bounding_box(v.get_instance_transformation().get_matrix(true, true, false, true) * v.get_volume_transformation().get_matrix(true, true, false, true));
|
||||
#endif // ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
m_center = v.world_matrix() * m_bounding_box.center();
|
||||
}
|
||||
else {
|
||||
|
@ -584,14 +560,9 @@ void GLGizmoMove3D::calc_selection_box_and_center()
|
|||
const GLVolume& v = *selection.get_volume(id);
|
||||
m_bounding_box.merge(v.transformed_convex_hull_bounding_box(v.get_volume_transformation().get_matrix()));
|
||||
}
|
||||
#if ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
const Geometry::Transformation inst_trafo = selection.get_first_volume()->get_instance_transformation();
|
||||
m_bounding_box = m_bounding_box.transformed(inst_trafo.get_scaling_factor_matrix());
|
||||
m_center = inst_trafo.get_matrix_no_scaling_factor() * m_bounding_box.center();
|
||||
#else
|
||||
m_bounding_box = m_bounding_box.transformed(selection.get_first_volume()->get_instance_transformation().get_matrix(true, true, false, true));
|
||||
m_center = selection.get_first_volume()->get_instance_transformation().get_matrix(false, false, true, false) * m_bounding_box.center();
|
||||
#endif // ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_WORLD_COORDINATE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue