Fix local entity grabbing on desktop
This commit is contained in:
parent
b9ebb7bb9f
commit
9a391c69da
@ -387,6 +387,7 @@ function makeNameTag(uuid) {
|
|||||||
.add("dimensions", scaledDimensions)
|
.add("dimensions", scaledDimensions)
|
||||||
.add("parentID", parentID)
|
.add("parentID", parentID)
|
||||||
.add("localPosition", localPosition)
|
.add("localPosition", localPosition)
|
||||||
|
.add("grab", { grabbable: false })
|
||||||
.create(CLEAR_ENTITY_EDIT_PROPS);
|
.create(CLEAR_ENTITY_EDIT_PROPS);
|
||||||
|
|
||||||
Script.setTimeout(function () {
|
Script.setTimeout(function () {
|
||||||
|
@ -202,19 +202,13 @@ function Grabber() {
|
|||||||
this.liftKey = false; // SHIFT
|
this.liftKey = false; // SHIFT
|
||||||
this.rotateKey = false; // CONTROL
|
this.rotateKey = false; // CONTROL
|
||||||
|
|
||||||
this.mouseRayOverlays = Picks.createPick(PickType.Ray, {
|
|
||||||
joint: "Mouse",
|
|
||||||
filter: Picks.PICK_OVERLAYS | Picks.PICK_INCLUDE_NONCOLLIDABLE,
|
|
||||||
enabled: true
|
|
||||||
});
|
|
||||||
var tabletItems = getMainTabletIDs();
|
|
||||||
if (tabletItems.length > 0) {
|
|
||||||
Picks.setIncludeItems(this.mouseRayOverlays, tabletItems);
|
|
||||||
}
|
|
||||||
var renderStates = [{name: "grabbed", end: beacon}];
|
var renderStates = [{name: "grabbed", end: beacon}];
|
||||||
this.mouseRayEntities = Pointers.createRayPointer({
|
this.mouseRayEntities = Pointers.createRayPointer({
|
||||||
joint: "Mouse",
|
joint: "Mouse",
|
||||||
filter: Picks.PICK_ENTITIES | Picks.PICK_INCLUDE_NONCOLLIDABLE,
|
filter: Picks.PICK_DOMAIN_ENTITIES |
|
||||||
|
Picks.PICK_AVATAR_ENTITIES |
|
||||||
|
Picks.PICK_LOCAL_ENTITIES |
|
||||||
|
Picks.PICK_INCLUDE_NONCOLLIDABLE,
|
||||||
faceAvatar: true,
|
faceAvatar: true,
|
||||||
scaleWithParent: true,
|
scaleWithParent: true,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@ -224,10 +218,8 @@ function Grabber() {
|
|||||||
|
|
||||||
Grabber.prototype.setPicksAndPointersEnabled = function(enabled) {
|
Grabber.prototype.setPicksAndPointersEnabled = function(enabled) {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
Picks.enablePick(this.mouseRayOverlays);
|
|
||||||
Pointers.enablePointer(this.mouseRayEntities);
|
Pointers.enablePointer(this.mouseRayEntities);
|
||||||
} else {
|
} else {
|
||||||
Picks.disablePick(this.mouseRayOverlays);
|
|
||||||
Pointers.disablePointer(this.mouseRayEntities);
|
Pointers.disablePointer(this.mouseRayEntities);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -283,11 +275,6 @@ Grabber.prototype.pressEvent = function(event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var overlayResult = Picks.getPrevPickResult(this.mouseRayOverlays);
|
|
||||||
if (overlayResult.type != Picks.INTERSECTED_NONE) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var pickResults = Pointers.getPrevPickResult(this.mouseRayEntities);
|
var pickResults = Pointers.getPrevPickResult(this.mouseRayEntities);
|
||||||
if (pickResults.type == Picks.INTERSECTED_NONE) {
|
if (pickResults.type == Picks.INTERSECTED_NONE) {
|
||||||
Pointers.setRenderState(this.mouseRayEntities, "");
|
Pointers.setRenderState(this.mouseRayEntities, "");
|
||||||
@ -494,7 +481,6 @@ Grabber.prototype.keyPressEvent = function(event) {
|
|||||||
|
|
||||||
Grabber.prototype.cleanup = function() {
|
Grabber.prototype.cleanup = function() {
|
||||||
Pointers.removePointer(this.mouseRayEntities);
|
Pointers.removePointer(this.mouseRayEntities);
|
||||||
Picks.removePick(this.mouseRayOverlays);
|
|
||||||
if (this.grabID) {
|
if (this.grabID) {
|
||||||
MyAvatar.releaseGrab(this.grabID);
|
MyAvatar.releaseGrab(this.grabID);
|
||||||
this.grabID = null;
|
this.grabID = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user