mirror of
https://github.com/overte-org/overte.git
synced 2025-06-15 18:19:15 +02:00
Can now grab tablet in 2d mode even when it embedded in geometry
This commit is contained in:
parent
9df887de2a
commit
5890503ec0
1 changed files with 2 additions and 1 deletions
|
@ -252,6 +252,7 @@ WebTablet.prototype.geometryChanged = function (geometry) {
|
||||||
// calclulate the appropriate position of the tablet in world space, such that it fits in the center of the screen.
|
// calclulate the appropriate position of the tablet in world space, such that it fits in the center of the screen.
|
||||||
// with a bit of padding on the top and bottom.
|
// with a bit of padding on the top and bottom.
|
||||||
WebTablet.prototype.calculateWorldAttitudeRelativeToCamera = function () {
|
WebTablet.prototype.calculateWorldAttitudeRelativeToCamera = function () {
|
||||||
|
|
||||||
var fov = (Settings.getValue('fieldOfView') || DEFAULT_VERTICAL_FIELD_OF_VIEW) * (Math.PI / 180);
|
var fov = (Settings.getValue('fieldOfView') || DEFAULT_VERTICAL_FIELD_OF_VIEW) * (Math.PI / 180);
|
||||||
var MAX_PADDING_FACTOR = 2.2;
|
var MAX_PADDING_FACTOR = 2.2;
|
||||||
var PADDING_FACTOR = Math.min(Window.innerHeight / TABLET_TEXTURE_RESOLUTION.y, MAX_PADDING_FACTOR);
|
var PADDING_FACTOR = Math.min(Window.innerHeight / TABLET_TEXTURE_RESOLUTION.y, MAX_PADDING_FACTOR);
|
||||||
|
@ -357,7 +358,7 @@ WebTablet.prototype.getPosition = function () {
|
||||||
|
|
||||||
WebTablet.prototype.mousePressEvent = function (event) {
|
WebTablet.prototype.mousePressEvent = function (event) {
|
||||||
var pickRay = Camera.computePickRay(event.x, event.y);
|
var pickRay = Camera.computePickRay(event.x, event.y);
|
||||||
var entityPickResults = Entities.findRayIntersection(pickRay, true); // non-accurate picking
|
var entityPickResults = Entities.findRayIntersection(pickRay, true, [this.tabletEntityID]); // non-accurate picking
|
||||||
if (entityPickResults.intersects && entityPickResults.entityID === this.tabletEntityID) {
|
if (entityPickResults.intersects && entityPickResults.entityID === this.tabletEntityID) {
|
||||||
var overlayPickResults = Overlays.findRayIntersection(pickRay);
|
var overlayPickResults = Overlays.findRayIntersection(pickRay);
|
||||||
if (overlayPickResults.intersects && overlayPickResults.overlayID === HMD.homeButtonID) {
|
if (overlayPickResults.intersects && overlayPickResults.overlayID === HMD.homeButtonID) {
|
||||||
|
|
Loading…
Reference in a new issue