Skip to content

Commit

Permalink
added getSpatialCursorEvent() to edge server, update core addon to la…
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
Steve-KX-RL committed Jul 31, 2023
1 parent 7532051 commit fdee5fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions libraries/objectDefaultFiles/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@
this.getUserDetails = makeSendStub('getUserDetails');
this.getAreaTargetMesh = makeSendStub('getAreaTargetMesh');
this.getMainCameraMatrix = makeSendStub('getMainCameraMatrix');
this.getSpatialCursorEvent = makeSendStub('getSpatialCursorEvent');

this.analyticsOpen = makeSendStub('analyticsOpen');
this.analyticsClose = makeSendStub('analyticsClose');
Expand Down Expand Up @@ -2178,6 +2179,20 @@
}
})
}

this.getSpatialCursorEvent = function() {
postDataToParent({
getSpatialCursorEvent: true
});
return new Promise((resolve, reject) => {
spatialObject.messageCallBacks.spatialCursorEventResult = function (msgContent) {
if (typeof msgContent.spatialCursorEvent !== 'undefined') {
resolve(msgContent.spatialCursorEvent);
delete spatialObject.messageCallBacks['spatialCursorEventResult'];
}
}
})
}

/**
* Stubbed here for backwards compatibility of API. In previous versions:
Expand Down

0 comments on commit fdee5fd

Please sign in to comment.