From 29dbc013611decdbd938adf2d2d67975b630360b Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 3 Aug 2018 08:12:44 +1200 Subject: [PATCH] Add alternative code to position Oculus sensors at correct elevation --- scripts/system/controllers/controllerModules/teleport.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/system/controllers/controllerModules/teleport.js b/scripts/system/controllers/controllerModules/teleport.js index 1a9e12e262..2b273c60d6 100644 --- a/scripts/system/controllers/controllerModules/teleport.js +++ b/scripts/system/controllers/controllerModules/teleport.js @@ -263,8 +263,15 @@ Script.include("/~/system/libraries/controllers.js"); for (var i = 0; i < this.playAreaSensorPositionOverlays.length; i++) { var localPosition = this.playAreaSensorPositions[i]; localPosition = Vec3.multiply(avatarScale, localPosition); + /* + // Position at the correct elevation. Tracking origin is at eye height. + localPosition.y = MyAvatar.getEyeHeight() + localPosition.y + - avatarScale * this.PLAY_AREA_SENSOR_OVERLAY_DIMENSIONS.y / 2 + - this.playAreaCenterOffset.y / 2; + */ + // Position on the floor. localPosition.y = avatarScale * this.PLAY_AREA_SENSOR_OVERLAY_DIMENSIONS.y / 2 - - this.playAreaCenterOffset.y / 2; // Position on the floor. + - this.playAreaCenterOffset.y / 2; Overlays.editOverlay(this.playAreaSensorPositionOverlays[i], { dimensions: Vec3.multiply(this.playAreaScaleFactor * avatarScale, this.PLAY_AREA_SENSOR_OVERLAY_DIMENSIONS), parentID: this.playAreaOverlay,