From 10e29d1cf0802fa9a502f25e4fbe43e0f487ddd9 Mon Sep 17 00:00:00 2001 From: Daniela Date: Fri, 8 Sep 2017 12:45:29 +0100 Subject: [PATCH] Decrease offset for teleport pad. Add Bubble orientation and scale correction. --- interface/src/raypick/LaserPointer.cpp | 3 +- scripts/system/bubble.js | 39 ++++++++++++++++---------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/interface/src/raypick/LaserPointer.cpp b/interface/src/raypick/LaserPointer.cpp index bfd91e5c84..d9475a8d9b 100644 --- a/interface/src/raypick/LaserPointer.cpp +++ b/interface/src/raypick/LaserPointer.cpp @@ -148,9 +148,8 @@ void LaserPointer::updateRenderState(const RenderState& renderState, const Inter endProps.insert("position", end); } else { glm::vec3 dim = vec3FromVariant(qApp->getOverlays().getProperty(renderState.getEndID(), "dimensions").value); - //endProps.insert("position", vec3toVariant(endVec + glm::vec3(0, 0.5f * dim.y, 0))); glm::vec3 currentUpVector = faceAvatarRotation * Vectors::UP; - endProps.insert("position", vec3toVariant(endVec + glm::vec3(currentUpVector.x * 0.5f * dim.x, currentUpVector.y * 0.5f * dim.y, currentUpVector.z * 0.5f * dim.z))); + endProps.insert("position", vec3toVariant(endVec + glm::vec3(currentUpVector.x * 0.25f * dim.x, currentUpVector.y * 0.25f * dim.y, currentUpVector.z * 0.25f * dim.z))); } if (_faceAvatar) { endProps.insert("rotation", quatToVariant(faceAvatarRotation)); diff --git a/scripts/system/bubble.js b/scripts/system/bubble.js index c2a2f7af40..afb9328a52 100644 --- a/scripts/system/bubble.js +++ b/scripts/system/bubble.js @@ -27,8 +27,9 @@ url: Script.resolvePath("assets/models/Bubble-v14.fbx"), // If you'd like to change the model, modify this line (and the dimensions below) dimensions: { x: 1.0, y: 0.75, z: 1.0 }, position: { x: MyAvatar.position.x, y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, z: MyAvatar.position.z }, - rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll), - scale: { x: 2, y: MyAvatar.scale * 0.5 + 0.5, z: 2 }, + //rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll), + rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})), + scale: { x: 2*MyAvatar.sensorToWorldScale, y: MyAvatar.scale * 0.5 + 0.5*MyAvatar.sensorToWorldScale, z: 2*MyAvatar.sensorToWorldScale }, visible: false, ignoreRayIntersection: true }); @@ -62,9 +63,17 @@ } Overlays.editOverlay(bubbleOverlay, { - position: { x: MyAvatar.position.x, y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, z: MyAvatar.position.z }, - rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll), - scale: { x: 2, y: MyAvatar.scale * 0.5 + 0.5, z: 2 }, + position: { + x: MyAvatar.position.x, + y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, + z: MyAvatar.position.z + }, + rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})), + scale: { + x: 2 * MyAvatar.sensorToWorldScale, + y: MyAvatar.scale * 0.5 + 0.5 * MyAvatar.sensorToWorldScale, + z: 2 * MyAvatar.sensorToWorldScale + }, visible: true }); bubbleOverlayTimestamp = Date.now(); @@ -105,11 +114,11 @@ y: (-((BUBBLE_RAISE_ANIMATION_DURATION_MS - delay) / BUBBLE_RAISE_ANIMATION_DURATION_MS)) * MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, z: MyAvatar.position.z }, - rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll), - scale: { - x: 2, - y: ((1 - ((BUBBLE_RAISE_ANIMATION_DURATION_MS - delay) / BUBBLE_RAISE_ANIMATION_DURATION_MS)) * MyAvatar.scale * 0.5 + 0.5), - z: 2 + rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})), + scale: { + x: 2 * MyAvatar.sensorToWorldScale, + y: ((1 - ((BUBBLE_RAISE_ANIMATION_DURATION_MS - delay) / BUBBLE_RAISE_ANIMATION_DURATION_MS)) * MyAvatar.scale * 0.5 + 0.5 * MyAvatar.sensorToWorldScale), + z: 2 * MyAvatar.sensorToWorldScale } }); } else { @@ -120,11 +129,11 @@ y: MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, z: MyAvatar.position.z }, - rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll), - scale: { - x: 2, - y: MyAvatar.scale * 0.5 + 0.5, - z: 2 + rotation: Quat.multiply(MyAvatar.orientation, Quat.fromVec3Degrees({x: 0.0, y: 180.0, z: 0.0})), + scale: { + x: 2 * MyAvatar.sensorToWorldScale, + y: MyAvatar.scale * 0.5 + 0.5 * MyAvatar.sensorToWorldScale, + z: 2 * MyAvatar.sensorToWorldScale } }); }