Fix issue moving groups in local space

This commit is contained in:
JannisX11 2021-02-01 23:37:59 +01:00
parent 2df0b1f397
commit eb3c3c9c2e
2 changed files with 2 additions and 4 deletions

View File

@ -874,7 +874,7 @@
let space = Transformer.getTransformSpace();
//Rotation
if (space === 2 || Toolbox.selected.id == 'resize_tool') {
Transformer.rotation_ref = selected[0] && selected[0].mesh;
Transformer.rotation_ref = Group.selected ? Group.selected.mesh : (selected[0] && selected[0].mesh);
if (Toolbox.selected.id == 'rotate_tool' && Group.selected) {
Transformer.rotation_ref = Group.selected.mesh;
}

View File

@ -580,9 +580,7 @@ function moveElementsInSpace(difference, axis) {
group_m = new THREE.Vector3();
group_m[getAxisLetter(axis)] = difference;
var rotation = new THREE.Quaternion();
group.mesh.getWorldQuaternion(rotation);
group_m.applyQuaternion(rotation);
group_m.applyQuaternion(group.mesh.quaternion);
group.forEachChild(g => {
g.origin.V3_add(group_m.x, group_m.y, group_m.z);