Skip to content

Commit

Permalink
Merge branch 'overte-org:master' into More-ng
Browse files Browse the repository at this point in the history
  • Loading branch information
Armored-Dragon authored Feb 25, 2024
2 parents 34c6647 + c19142c commit 9a48eac
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
23 changes: 12 additions & 11 deletions libraries/entities-renderer/src/EntityTreeRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ QUuid EntityTreeRenderer::mousePressEvent(QMouseEvent* event) {
pos2D, rayPickResult.intersection,
rayPickResult.surfaceNormal, ray.direction,
toPointerButton(*event), toPointerButtons(*event),
Qt::NoModifier); // TODO -- check for modifier keys?
event->modifiers());

emit entityScriptingInterface->mousePressOnEntity(rayPickResult.entityID, pointerEvent);

Expand Down Expand Up @@ -959,9 +959,10 @@ void EntityTreeRenderer::mouseDoublePressEvent(QMouseEvent* event) {
if (rayPickResult.intersects && (entity = getTree()->findEntityByID(rayPickResult.entityID))) {
glm::vec2 pos2D = projectOntoEntityXYPlane(entity, ray, rayPickResult);
PointerEvent pointerEvent(PointerEvent::Press, PointerManager::MOUSE_POINTER_ID,
pos2D, rayPickResult.intersection,
rayPickResult.surfaceNormal, ray.direction,
toPointerButton(*event), toPointerButtons(*event), Qt::NoModifier);
pos2D, rayPickResult.intersection,
rayPickResult.surfaceNormal, ray.direction,
toPointerButton(*event), toPointerButtons(*event),
event->modifiers());

emit entityScriptingInterface->mouseDoublePressOnEntity(rayPickResult.entityID, pointerEvent);

Expand Down Expand Up @@ -995,7 +996,7 @@ void EntityTreeRenderer::mouseReleaseEvent(QMouseEvent* event) {
pos2D, rayPickResult.intersection,
rayPickResult.surfaceNormal, ray.direction,
toPointerButton(*event), toPointerButtons(*event),
Qt::NoModifier); // TODO -- check for modifier keys?
event->modifiers());

emit entityScriptingInterface->mouseReleaseOnEntity(rayPickResult.entityID, pointerEvent);

Expand All @@ -1011,7 +1012,7 @@ void EntityTreeRenderer::mouseReleaseEvent(QMouseEvent* event) {
pos2D, rayPickResult.intersection,
rayPickResult.surfaceNormal, ray.direction,
toPointerButton(*event), toPointerButtons(*event),
Qt::NoModifier); // TODO -- check for modifier keys?
event->modifiers());

emit entityScriptingInterface->clickReleaseOnEntity(_currentClickingOnEntityID, pointerEvent);
}
Expand All @@ -1038,7 +1039,7 @@ void EntityTreeRenderer::mouseMoveEvent(QMouseEvent* event) {
pos2D, rayPickResult.intersection,
rayPickResult.surfaceNormal, ray.direction,
toPointerButton(*event), toPointerButtons(*event),
Qt::NoModifier); // TODO -- check for modifier keys?
event->modifiers());

emit entityScriptingInterface->mouseMoveOnEntity(rayPickResult.entityID, pointerEvent);

Expand All @@ -1052,7 +1053,7 @@ void EntityTreeRenderer::mouseMoveEvent(QMouseEvent* event) {
pos2D, rayPickResult.intersection,
rayPickResult.surfaceNormal, ray.direction,
toPointerButton(*event), toPointerButtons(*event),
Qt::NoModifier); // TODO -- check for modifier keys?
event->modifiers());

emit entityScriptingInterface->hoverLeaveEntity(_currentHoverOverEntityID, pointerEvent);
}
Expand Down Expand Up @@ -1080,10 +1081,10 @@ void EntityTreeRenderer::mouseMoveEvent(QMouseEvent* event) {
if (!_currentHoverOverEntityID.isInvalidID()) {
glm::vec2 pos2D = projectOntoEntityXYPlane(entity, ray, rayPickResult);
PointerEvent pointerEvent(PointerEvent::Move, PointerManager::MOUSE_POINTER_ID,
pos2D, rayPickResult.intersection,
rayPickResult.surfaceNormal, ray.direction,
pos2D, rayPickResult.intersection,
rayPickResult.surfaceNormal, ray.direction,
toPointerButton(*event), toPointerButtons(*event),
Qt::NoModifier); // TODO -- check for modifier keys?
event->modifiers());

emit entityScriptingInterface->hoverLeaveEntity(_currentHoverOverEntityID, pointerEvent);
_currentHoverOverEntityID = UNKNOWN_ENTITY_ID; // makes it the unknown ID
Expand Down
3 changes: 3 additions & 0 deletions libraries/script-engine/src/ScriptMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#include <QJsonObject>
#include "EntityItemID.h"

// SEVERITY_ERROR is defined as a macro in winerror.h
#undef SEVERITY_ERROR

class ScriptMessage {
public:
enum class ScriptType {
Expand Down
15 changes: 8 additions & 7 deletions scripts/system/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// Created by Adrian McCarlie on October 8th, 2014
// Copyright 2014 High Fidelity, Inc.
// Copyright 2022-2023 Overte e.V.
// Copyright 2022-2024 Overte e.V.
//
// Display notifications to the user for some specific events.
//
Expand Down Expand Up @@ -35,8 +35,7 @@

//DESKTOP OVERLAY PROPERTIES
var overlayWidth = 340.0; //width in pixel of notification overlay in desktop
var windowDimensions = Controller.getViewportDimensions(); // get the size of the interface window
var overlayLocationX = (windowDimensions.x - (overlayWidth + 20.0)); // positions window 20px from the right of the interface window
var overlayLocationX = (Window.innerWidth - (overlayWidth + 20.0)); // positions window 20px from the right of the interface window
var overlayLocationY = 20.0; // position down from top of interface window
var overlayTopMargin = 13.0;
var overlayLeftMargin = 10.0;
Expand All @@ -46,9 +45,10 @@

//HMD NOTIFICATION PANEL PROPERTIES
var HMD_UI_SCALE_FACTOR = 1.0; //This define the size of all the notification system in HMD.
var hmdPanelLocalPosition = {"x": 1.2, "y": 2, "z": -1.0};
var hmdPanelLocalRotation = Quat.fromVec3Degrees({"x": 0, "y": -15, "z": 0});
var hmdPanelLocalPosition = {"x": 0.3, "y": 0.25, "z": -1.5};
var hmdPanelLocalRotation = Quat.fromVec3Degrees({"x": 0, "y": -3, "z": 0});
var mainHMDnotificationContainerID = Uuid.NULL;
var CAMERA_MATRIX_INDEX = -7;

//HMD LOCAL ENTITY PROPERTIES
var entityWidth = 0.8; //in meter
Expand Down Expand Up @@ -87,6 +87,7 @@

//DISPLAY
function renderNotifications(remainingTime) {
overlayLocationX = (Window.innerWidth - (overlayWidth + 20.0));
var alpha = NOTIFICATION_ALPHA;
if (remainingTime < FADE_OUT_DURATION) {
alpha = NOTIFICATION_ALPHA * (remainingTime/FADE_OUT_DURATION);
Expand Down Expand Up @@ -190,7 +191,7 @@
"subImage": { "x": 0, "y": 0 },
"visible": true,
"alpha": alpha
};
};
if (notifications[i].imageOverlayID === Uuid.NULL){
properties.imageURL = notifications[i].dataImage.path;
notifications[i].imageOverlayID = Overlays.addOverlay("image", properties);
Expand Down Expand Up @@ -239,7 +240,7 @@
"visible": false,
"dimensions": {"x": 0.1, "y": 0.1, "z":0.1},
"parentID": MyAvatar.sessionUUID,
"parentJointIndex": -2,
"parentJointIndex": CAMERA_MATRIX_INDEX,
"localPosition": hmdPanelLocalPosition,
"localRotation": hmdPanelLocalRotation
};
Expand Down
1 change: 1 addition & 0 deletions tools/jsdoc/plugins/hifi.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ exports.handlers = {
'../../libraries/plugins/src/plugins',
'../../libraries/procedural/src/procedural',
'../../libraries/pointers/src',
'../../libraries/recording/src/recording',
'../../libraries/render-utils/src',
'../../libraries/script-engine/src',
'../../libraries/shared/src',
Expand Down

0 comments on commit 9a48eac

Please sign in to comment.