checkpoint manual support work
This commit is contained in:
parent
1a02ff192f
commit
f4951478dc
3 changed files with 30 additions and 10 deletions
|
|
@ -1914,6 +1914,13 @@
|
|||
});
|
||||
|
||||
SPACE.mouse.downSelect((int,event) => {
|
||||
if (API.feature.hover) {
|
||||
if (int) {
|
||||
API.event.emit('mouse.hover.down', int);
|
||||
return
|
||||
}
|
||||
return API.widgets.meshes();
|
||||
}
|
||||
// lay flat with meta or ctrl clicking a selected face
|
||||
if (int && (event.ctrlKey || event.metaKey || API.feature.on_face_select)) {
|
||||
let q = new THREE.Quaternion();
|
||||
|
|
@ -1931,6 +1938,10 @@
|
|||
});
|
||||
|
||||
SPACE.mouse.upSelect(function(selection, event) {
|
||||
if (event && API.feature.hover) {
|
||||
API.event.emit('mouse.hover.up', selection);
|
||||
return;
|
||||
}
|
||||
if (event && event.target.nodeName === "CANVAS") {
|
||||
if (selection) {
|
||||
platform.select(selection.object.widget, event.shiftKey);
|
||||
|
|
@ -1943,6 +1954,7 @@
|
|||
});
|
||||
|
||||
SPACE.mouse.onDrag(function(delta) {
|
||||
if (API.feature.hover) return;
|
||||
if (delta && UI.freeLayout.checked) {
|
||||
let set = settings();
|
||||
let dev = set.device;
|
||||
|
|
|
|||
|
|
@ -23,28 +23,35 @@
|
|||
});
|
||||
api.event.on("button.click", target => {
|
||||
switch (target) {
|
||||
case api.ui.ssmAdd: return func.sadd();
|
||||
case api.ui.ssmClr: return func.sclear();
|
||||
case api.ui.ssmAdd:
|
||||
return func.sadd();
|
||||
case api.ui.ssmClr:
|
||||
api.uc.confirm("clear supports?").then(ok => {
|
||||
if (ok) func.sclear();
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
api.event.on("fdm.supports.add", func.sadd = () => {
|
||||
api.show.alert("<esc> key when done editing supports");
|
||||
console.log("supports add");
|
||||
api.feature.hover = true;
|
||||
console.log("supports add");
|
||||
});
|
||||
api.event.on("fdm.supports.done", func.sdone = () => {
|
||||
delbox('intZ');
|
||||
delbox('intW');
|
||||
api.feature.hover = false;
|
||||
console.log("supports done");
|
||||
});
|
||||
api.event.on("fdm.supports.clear", func.sclear = () => {
|
||||
api.uc.confirm("clear supports?").then(ok => {
|
||||
func.sdone();
|
||||
if (ok) console.log("supports clear");
|
||||
});
|
||||
func.sdone();
|
||||
console.log("supports clear");
|
||||
});
|
||||
api.event.on("key.esc", func.sdone);
|
||||
api.event.on("mouse.hover", (data) => {
|
||||
api.event.on("mouse.hover.up", int => {
|
||||
// console.log({hover_up: int});
|
||||
});
|
||||
api.event.on("mouse.hover", data => {
|
||||
const { int, type, point } = data;
|
||||
if (SPACE._int1) {
|
||||
SPACE.scene.remove(SPACE._int1);
|
||||
|
|
@ -56,7 +63,8 @@
|
|||
if (int && int.face && int.face.normal.z < -0.1) {
|
||||
dir.y = -1;
|
||||
}
|
||||
let i2 = ray.intersectObjects(api.widgets.meshes(), false);
|
||||
let targets = api.widgets.meshes().append(SPACE.internals().platform);
|
||||
let i2 = ray.intersectObjects(targets, false);
|
||||
if (i2 && i2.length > 0) {
|
||||
// prevent false matches close to origin of ray
|
||||
i2 = i2.filter(i => i.distance > 0.01);
|
||||
|
|
|
|||
|
|
@ -888,7 +888,7 @@
|
|||
},
|
||||
|
||||
internals: function() {
|
||||
return { renderer, camera };
|
||||
return { renderer, camera, platform };
|
||||
},
|
||||
|
||||
init: function(domelement, slider) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue