mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-13 23:46:29 +02:00
Decrease offset for teleport pad. Add Bubble orientation and scale correction.
This commit is contained in:
parent
fde5e14c04
commit
10e29d1cf0
2 changed files with 25 additions and 17 deletions
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue