mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 04:57:58 +02:00
don't use Entities.getEntityProperties on tablet when it's an overlay
This commit is contained in:
parent
2c42309aaa
commit
9c0104a060
1 changed files with 15 additions and 2 deletions
|
@ -193,7 +193,16 @@ WebTablet = function (url, width, dpi, hand, clientOnly) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getLocation = function() {
|
this.getLocation = function() {
|
||||||
return Entities.getEntityProperties(_this.tabletEntityID, ["localPosition", "localRotation"]);
|
if (this.tabletIsOverlay) {
|
||||||
|
var location = Overlays.getProperty(this.tabletEntityID, "localPosition");
|
||||||
|
var orientation = Overlays.getProperty(this.tabletEntityID, "localOrientation");
|
||||||
|
return {
|
||||||
|
localPosition: location,
|
||||||
|
localRotation: orientation
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return Entities.getEntityProperties(_this.tabletEntityID, ["localPosition", "localRotation"]);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
this.clicked = false;
|
this.clicked = false;
|
||||||
|
|
||||||
|
@ -461,7 +470,11 @@ WebTablet.prototype.mousePressEvent = function (event) {
|
||||||
this.dragging = true;
|
this.dragging = true;
|
||||||
var invCameraXform = new Xform(Camera.orientation, Camera.position).inv();
|
var invCameraXform = new Xform(Camera.orientation, Camera.position).inv();
|
||||||
this.initialLocalIntersectionPoint = invCameraXform.xformPoint(entityPickResults.intersection);
|
this.initialLocalIntersectionPoint = invCameraXform.xformPoint(entityPickResults.intersection);
|
||||||
this.initialLocalPosition = Entities.getEntityProperties(this.tabletEntityID, ["localPosition"]).localPosition;
|
if (this.tabletIsOverlay) {
|
||||||
|
this.initialLocalPosition = Overlays.getProperty(this.tabletEntityID, "localPosition");
|
||||||
|
} else {
|
||||||
|
this.initialLocalPosition = Entities.getEntityProperties(this.tabletEntityID, ["localPosition"]).localPosition;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue