mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-07 23:09:36 +02:00
only clamp handles in hmd outside bounding box
This commit is contained in:
parent
81f5631ce9
commit
7a7b9730ee
1 changed files with 9 additions and 8 deletions
|
@ -1186,10 +1186,17 @@ SelectionDisplay = (function() {
|
||||||
var localRotationZ = Quat.fromPitchYawRollDegrees(rotationDegrees, 0, 0);
|
var localRotationZ = Quat.fromPitchYawRollDegrees(rotationDegrees, 0, 0);
|
||||||
var rotationZ = Quat.multiply(rotation, localRotationZ);
|
var rotationZ = Quat.multiply(rotation, localRotationZ);
|
||||||
worldRotationZ = rotationZ;
|
worldRotationZ = rotationZ;
|
||||||
|
|
||||||
|
var selectionBoxGeometry = {
|
||||||
|
position: position,
|
||||||
|
rotation: rotation,
|
||||||
|
dimensions: dimensions
|
||||||
|
};
|
||||||
|
var isCameraInsideBox = isPointInsideBox(Camera.position, selectionBoxGeometry);
|
||||||
|
|
||||||
// in HMD we clamp the overlays to the bounding box for now so lasers can hit them
|
// in HMD if outside the bounding box clamp the overlays to the bounding box for now so lasers can hit them
|
||||||
var maxHandleDimension = 0;
|
var maxHandleDimension = 0;
|
||||||
if (HMD.active) {
|
if (HMD.active && !isCameraInsideBox) {
|
||||||
maxHandleDimension = Math.max(dimensions.x, dimensions.y, dimensions.z);
|
maxHandleDimension = Math.max(dimensions.x, dimensions.y, dimensions.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1438,12 +1445,6 @@ SelectionDisplay = (function() {
|
||||||
var inModeRotate = isActiveTool(handleRotatePitchRing) ||
|
var inModeRotate = isActiveTool(handleRotatePitchRing) ||
|
||||||
isActiveTool(handleRotateYawRing) ||
|
isActiveTool(handleRotateYawRing) ||
|
||||||
isActiveTool(handleRotateRollRing);
|
isActiveTool(handleRotateRollRing);
|
||||||
var selectionBoxGeometry = {
|
|
||||||
position: position,
|
|
||||||
rotation: rotation,
|
|
||||||
dimensions: dimensions
|
|
||||||
};
|
|
||||||
var isCameraInsideBox = isPointInsideBox(Camera.position, selectionBoxGeometry);
|
|
||||||
selectionBoxGeometry.visible = !inModeRotate && !isCameraInsideBox;
|
selectionBoxGeometry.visible = !inModeRotate && !isCameraInsideBox;
|
||||||
Overlays.editOverlay(selectionBox, selectionBoxGeometry);
|
Overlays.editOverlay(selectionBox, selectionBoxGeometry);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue