cleanup rotation / scale and stub in rotation reset

This commit is contained in:
Stewart Allen 2020-06-13 22:52:46 -04:00
commit a9b04ad26f
4 changed files with 30 additions and 11 deletions

View file

@ -112,6 +112,7 @@
if (groups.indexOf(this.group) < 0) {
groups.push(this.group);
}
this.roto = new THREE.Matrix4();
this.mesh = null;
this.points = null;
// todo resolve use of this vs. mesh.bounds
@ -548,7 +549,8 @@
} else {
m4 = m4.makeRotationFromQuaternion(x);
}
this.mesh.geometry.applyMatrix4(m4);
this.roto.multiply(m4);
this.mesh.geometry.applyMatrix4(new THREE.Matrix4().getInverse(m4));
if (!temp && euler) {
let rot = this.track.rot;
rot.x += (x || 0);
@ -557,6 +559,10 @@
}
};
PRO.unrotate = function() {
this.mesh.geometry.applyMatrix4(this.roto);
};
PRO.mirror = function() {
this.group.forEach(w => {
w._mirror();