Add alternative code to position Oculus sensors at correct elevation

This commit is contained in:
David Rowe 2018-08-03 08:12:44 +12:00
parent 57da0fef63
commit 29dbc01361

View file

@ -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,