mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:24:00 +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) {
|
||||
case grabberMoveUp:
|
||||
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;
|
||||
break;
|
||||
|
||||
case grabberRBN:
|
||||
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;
|
||||
break;
|
||||
|
||||
|
@ -913,17 +893,6 @@ SelectionDisplay = (function () {
|
|||
case grabberEdgeTN:
|
||||
case grabberEdgeBN:
|
||||
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;
|
||||
break;
|
||||
|
||||
|
@ -956,16 +925,6 @@ SelectionDisplay = (function () {
|
|||
switch(result.overlayID) {
|
||||
case selectionBox:
|
||||
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;
|
||||
break;
|
||||
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...
|
||||
// TODO: we could optimize this since some of these were already flipped back
|
||||
Overlays.editOverlay(selectionBox, { ignoreRayIntersection: false });
|
||||
|
|
Loading…
Reference in a new issue