Tech ENABLE_TRANSFORMATIONS_BY_MATRICES - Reworked method void Selection::translate(unsigned int object_idx, unsigned int instance_idx, const Vec3d& displacement) to use matrix multiplication and removed unused method void Selection::translate(unsigned int object_idx, const Vec3d& displacement)
Fixed conflicts during rebase with master
This commit is contained in:
parent
2f6f73e10f
commit
55be16d158
@ -1292,6 +1292,7 @@ void Selection::mirror(Axis axis)
|
||||
set_bounding_boxes_dirty();
|
||||
}
|
||||
|
||||
#if !ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
void Selection::translate(unsigned int object_idx, const Vec3d& displacement)
|
||||
{
|
||||
if (!m_valid)
|
||||
@ -1340,6 +1341,7 @@ void Selection::translate(unsigned int object_idx, const Vec3d& displacement)
|
||||
|
||||
this->set_bounding_boxes_dirty();
|
||||
}
|
||||
#endif // !ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
|
||||
void Selection::translate(unsigned int object_idx, unsigned int instance_idx, const Vec3d& displacement)
|
||||
{
|
||||
@ -1349,7 +1351,11 @@ void Selection::translate(unsigned int object_idx, unsigned int instance_idx, co
|
||||
for (unsigned int i : m_list) {
|
||||
GLVolume& v = *(*m_volumes)[i];
|
||||
if (v.object_idx() == (int)object_idx && v.instance_idx() == (int)instance_idx)
|
||||
#if ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
v.set_instance_transformation(Geometry::assemble_transform(displacement) * v.get_instance_transformation().get_matrix());
|
||||
#else
|
||||
v.set_instance_offset(v.get_instance_offset() + displacement);
|
||||
#endif // ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
}
|
||||
|
||||
std::set<unsigned int> done; // prevent processing volumes twice
|
||||
@ -1382,7 +1388,11 @@ void Selection::translate(unsigned int object_idx, unsigned int instance_idx, co
|
||||
if (v.object_idx() != object_idx || v.instance_idx() != (int)instance_idx)
|
||||
continue;
|
||||
|
||||
#if ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
v.set_instance_transformation(Geometry::assemble_transform(displacement) * v.get_instance_transformation().get_matrix());
|
||||
#else
|
||||
v.set_instance_offset(v.get_instance_offset() + displacement);
|
||||
#endif // ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
done.insert(j);
|
||||
}
|
||||
}
|
||||
|
@ -363,7 +363,9 @@ public:
|
||||
void scale_to_fit_print_volume(const BuildVolume& volume);
|
||||
void mirror(Axis axis);
|
||||
|
||||
#if !ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
void translate(unsigned int object_idx, const Vec3d& displacement);
|
||||
#endif // !ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||
void translate(unsigned int object_idx, unsigned int instance_idx, const Vec3d& displacement);
|
||||
|
||||
#if ENABLE_WORLD_COORDINATE_SCALE_REVISITED
|
||||
|
Loading…
Reference in New Issue
Block a user