mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 21:57:00 +02:00
Removed rest of orbit/pan code in editVoxels.js
This commit is contained in:
parent
3721ce8e43
commit
53eaea6a22
1 changed files with 63 additions and 73 deletions
|
@ -32,8 +32,6 @@ var MIN_PASTE_VOXEL_SCALE = .256;
|
||||||
var zFightingSizeAdjust = 0.002; // used to adjust preview voxels to prevent z fighting
|
var zFightingSizeAdjust = 0.002; // used to adjust preview voxels to prevent z fighting
|
||||||
var previewLineWidth = 1.5;
|
var previewLineWidth = 1.5;
|
||||||
|
|
||||||
var oldMode = Camera.getMode();
|
|
||||||
var trackAsOrbitOrPan = false;
|
|
||||||
var isAdding = false;
|
var isAdding = false;
|
||||||
var isExtruding = false;
|
var isExtruding = false;
|
||||||
var extrudeDirection = { x: 0, y: 0, z: 0 };
|
var extrudeDirection = { x: 0, y: 0, z: 0 };
|
||||||
|
@ -614,8 +612,6 @@ function showPreviewVoxel() {
|
||||||
var guidePosition;
|
var guidePosition;
|
||||||
if (trackAsRecolor || recolorToolSelected || trackAsEyedropper || eyedropperToolSelected) {
|
if (trackAsRecolor || recolorToolSelected || trackAsEyedropper || eyedropperToolSelected) {
|
||||||
Overlays.editOverlay(voxelPreview, { visible: true });
|
Overlays.editOverlay(voxelPreview, { visible: true });
|
||||||
} else if (trackAsOrbitOrPan) {
|
|
||||||
Overlays.editOverlay(voxelPreview, { visible: false });
|
|
||||||
} else if (voxelToolSelected && !isExtruding) {
|
} else if (voxelToolSelected && !isExtruding) {
|
||||||
Overlays.editOverlay(voxelPreview, { visible: true });
|
Overlays.editOverlay(voxelPreview, { visible: true });
|
||||||
} else if (isExtruding) {
|
} else if (isExtruding) {
|
||||||
|
@ -706,15 +702,12 @@ function showPreviewGuides() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function trackMouseEvent(event) {
|
function trackMouseEvent(event) {
|
||||||
if (!trackAsOrbitOrPan) {
|
|
||||||
trackLastMouseX = event.x;
|
trackLastMouseX = event.x;
|
||||||
trackLastMouseY = event.y;
|
trackLastMouseY = event.y;
|
||||||
trackAsDelete = event.isControl;
|
trackAsDelete = event.isControl;
|
||||||
trackAsRecolor = event.isShifted;
|
trackAsRecolor = event.isShifted;
|
||||||
trackAsEyedropper = event.isMeta;
|
trackAsEyedropper = event.isMeta;
|
||||||
trackAsOrbitOrPan = event.isAlt; // TODO: double check this...??
|
|
||||||
showPreviewGuides();
|
showPreviewGuides();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function trackKeyPressEvent(event) {
|
function trackKeyPressEvent(event) {
|
||||||
|
@ -789,8 +782,6 @@ function mousePressEvent(event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// no clicking on overlays while in panning mode
|
|
||||||
if (!trackAsOrbitOrPan) {
|
|
||||||
var clickedOnSomething = false;
|
var clickedOnSomething = false;
|
||||||
var clickedOverlay = Overlays.getOverlayAtPoint({x: event.x, y: event.y});
|
var clickedOverlay = Overlays.getOverlayAtPoint({x: event.x, y: event.y});
|
||||||
|
|
||||||
|
@ -848,7 +839,6 @@ function mousePressEvent(event) {
|
||||||
if (clickedOnSomething) {
|
if (clickedOnSomething) {
|
||||||
return; // no further processing
|
return; // no further processing
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: does any of this stuff need to execute if we're panning or orbiting?
|
// TODO: does any of this stuff need to execute if we're panning or orbiting?
|
||||||
trackMouseEvent(event); // used by preview support
|
trackMouseEvent(event); // used by preview support
|
||||||
|
@ -1072,7 +1062,7 @@ function mouseMoveEvent(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!trackAsOrbitOrPan && isMovingSlider) {
|
if (isMovingSlider) {
|
||||||
thumbX = (event.x - thumbClickOffsetX) - sliderX;
|
thumbX = (event.x - thumbClickOffsetX) - sliderX;
|
||||||
if (thumbX < minThumbX) {
|
if (thumbX < minThumbX) {
|
||||||
thumbX = minThumbX;
|
thumbX = minThumbX;
|
||||||
|
@ -1082,7 +1072,7 @@ function mouseMoveEvent(event) {
|
||||||
}
|
}
|
||||||
calcScaleFromThumb(thumbX);
|
calcScaleFromThumb(thumbX);
|
||||||
|
|
||||||
} else if (!trackAsOrbitOrPan && isAdding) {
|
} else if (isAdding) {
|
||||||
// Watch the drag direction to tell which way to 'extrude' this voxel
|
// Watch the drag direction to tell which way to 'extrude' this voxel
|
||||||
if (!isExtruding) {
|
if (!isExtruding) {
|
||||||
var pickRay = Camera.computePickRay(event.x, event.y);
|
var pickRay = Camera.computePickRay(event.x, event.y);
|
||||||
|
|
Loading…
Reference in a new issue