mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 10:58:22 +02:00
dry up some code
This commit is contained in:
parent
4af3968e01
commit
88c983cd3b
1 changed files with 11 additions and 41 deletions
|
@ -881,31 +881,11 @@ SelectionDisplay = (function () {
|
||||||
switch(result.overlayID) {
|
switch(result.overlayID) {
|
||||||
case grabberMoveUp:
|
case grabberMoveUp:
|
||||||
mode = "TRANSLATE_UP_DOWN";
|
mode = "TRANSLATE_UP_DOWN";
|
||||||
|
|
||||||
pickRay = Camera.computePickRay(event.x, event.y);
|
|
||||||
lastPlaneIntersection = rayPlaneIntersection(pickRay, selectedEntityPropertiesOriginalPosition,
|
|
||||||
Quat.getFront(lastAvatarOrientation));
|
|
||||||
if (wantDebug) {
|
|
||||||
print("mousePressEvent()...... " + overlayNames[result.overlayID]);
|
|
||||||
print(" event.y:" + event.y);
|
|
||||||
Vec3.print(" lastPlaneIntersection:", lastPlaneIntersection);
|
|
||||||
Vec3.print(" originalPosition:", selectedEntityPropertiesOriginalPosition);
|
|
||||||
}
|
|
||||||
somethingClicked = true;
|
somethingClicked = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case grabberRBN:
|
case grabberRBN:
|
||||||
mode = "STRETCH_RBN";
|
mode = "STRETCH_RBN";
|
||||||
|
|
||||||
pickRay = Camera.computePickRay(event.x, event.y);
|
|
||||||
lastPlaneIntersection = rayPlaneIntersection(pickRay, selectedEntityPropertiesOriginalPosition,
|
|
||||||
Quat.getFront(lastAvatarOrientation));
|
|
||||||
if (wantDebug) {
|
|
||||||
print("mousePressEvent()...... " + overlayNames[result.overlayID]);
|
|
||||||
print(" event.y:" + event.y);
|
|
||||||
Vec3.print(" lastPlaneIntersection:", lastPlaneIntersection);
|
|
||||||
Vec3.print(" originalPosition:", selectedEntityPropertiesOriginalPosition);
|
|
||||||
}
|
|
||||||
somethingClicked = true;
|
somethingClicked = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -913,17 +893,6 @@ SelectionDisplay = (function () {
|
||||||
case grabberEdgeTN:
|
case grabberEdgeTN:
|
||||||
case grabberEdgeBN:
|
case grabberEdgeBN:
|
||||||
mode = "STRETCH_NEAR";
|
mode = "STRETCH_NEAR";
|
||||||
|
|
||||||
pickRay = Camera.computePickRay(event.x, event.y);
|
|
||||||
lastPlaneIntersection = rayPlaneIntersection(pickRay, selectedEntityPropertiesOriginalPosition,
|
|
||||||
Quat.getFront(lastAvatarOrientation));
|
|
||||||
if (wantDebug) {
|
|
||||||
print("mousePressEvent()...... " + overlayNames[result.overlayID]);
|
|
||||||
print(" event.y:" + event.y);
|
|
||||||
Vec3.print(" lastPlaneIntersection:", lastPlaneIntersection);
|
|
||||||
Vec3.print(" originalPosition:", selectedEntityPropertiesOriginalPosition);
|
|
||||||
print(" mode:" + mode);
|
|
||||||
}
|
|
||||||
somethingClicked = true;
|
somethingClicked = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -956,16 +925,6 @@ SelectionDisplay = (function () {
|
||||||
switch(result.overlayID) {
|
switch(result.overlayID) {
|
||||||
case selectionBox:
|
case selectionBox:
|
||||||
mode = "TRANSLATE_XZ";
|
mode = "TRANSLATE_XZ";
|
||||||
|
|
||||||
pickRay = Camera.computePickRay(event.x, event.y);
|
|
||||||
lastPlaneIntersection = rayPlaneIntersection(pickRay, selectedEntityPropertiesOriginalPosition,
|
|
||||||
Quat.getFront(lastAvatarOrientation));
|
|
||||||
if (wantDebug) {
|
|
||||||
print("mousePressEvent()...... " + overlayNames[result.overlayID]);
|
|
||||||
print(" event.y:" + event.y);
|
|
||||||
Vec3.print(" lastPlaneIntersection:", lastPlaneIntersection);
|
|
||||||
Vec3.print(" originalPosition:", selectedEntityPropertiesOriginalPosition);
|
|
||||||
}
|
|
||||||
somethingClicked = true;
|
somethingClicked = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -976,6 +935,17 @@ SelectionDisplay = (function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (somethingClicked) {
|
||||||
|
pickRay = Camera.computePickRay(event.x, event.y);
|
||||||
|
lastPlaneIntersection = rayPlaneIntersection(pickRay, selectedEntityPropertiesOriginalPosition,
|
||||||
|
Quat.getFront(lastAvatarOrientation));
|
||||||
|
if (wantDebug) {
|
||||||
|
print("mousePressEvent()...... " + overlayNames[result.overlayID]);
|
||||||
|
Vec3.print(" lastPlaneIntersection:", lastPlaneIntersection);
|
||||||
|
Vec3.print(" originalPosition:", selectedEntityPropertiesOriginalPosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// reset everything as intersectable...
|
// reset everything as intersectable...
|
||||||
// TODO: we could optimize this since some of these were already flipped back
|
// TODO: we could optimize this since some of these were already flipped back
|
||||||
Overlays.editOverlay(selectionBox, { ignoreRayIntersection: false });
|
Overlays.editOverlay(selectionBox, { ignoreRayIntersection: false });
|
||||||
|
|
Loading…
Reference in a new issue