fix lay flat

This commit is contained in:
Stewart Allen 2024-06-02 11:00:37 -04:00
commit 2f2009047e
3 changed files with 7 additions and 10 deletions

View file

@ -2760,7 +2760,7 @@ gapp.register("kiri.init", [], (root, exports) => {
};
$('context-duplicate').onclick = duplicateSelection;
$('context-mirror').onclick = mirrorSelection;
$('context-layflat').onclick = layFlat;
$('context-layflat').onclick = () => { api.event.emit("tool.mesh.lay-flat") };
$('context-setfocus').onclick = setFocus;
ui.modal.onclick = api.modal.hide;

View file

@ -126,8 +126,9 @@ api.event.on('mouse.hover', (ev) => {
pmesh.position.y = -v.z;
pmesh.position.z = v.y;
} else {
const zcomp = api.mode.get() === 'CAM' ? track.tzoff : 0;
pmesh.position.y = -point.z - opos.y + norm.y * 0.1;
pmesh.position.z = point.y + track.tzoff + norm.z * 0.1;
pmesh.position.z = point.y + zcomp + norm.z * 0.1;
}
let q = new Quaternion().setFromUnitVectors(ZAXIS,
new Vector3(norm.x,norm.y,norm.z)