only clamp handles in hmd outside bounding box

This commit is contained in:
David Back 2018-07-09 15:36:22 -07:00
parent 81f5631ce9
commit 7a7b9730ee

View file

@ -1186,10 +1186,17 @@ SelectionDisplay = (function() {
var localRotationZ = Quat.fromPitchYawRollDegrees(rotationDegrees, 0, 0);
var rotationZ = Quat.multiply(rotation, localRotationZ);
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;
if (HMD.active) {
if (HMD.active && !isCameraInsideBox) {
maxHandleDimension = Math.max(dimensions.x, dimensions.y, dimensions.z);
}
@ -1438,12 +1445,6 @@ SelectionDisplay = (function() {
var inModeRotate = isActiveTool(handleRotatePitchRing) ||
isActiveTool(handleRotateYawRing) ||
isActiveTool(handleRotateRollRing);
var selectionBoxGeometry = {
position: position,
rotation: rotation,
dimensions: dimensions
};
var isCameraInsideBox = isPointInsideBox(Camera.position, selectionBoxGeometry);
selectionBoxGeometry.visible = !inModeRotate && !isCameraInsideBox;
Overlays.editOverlay(selectionBox, selectionBoxGeometry);