Merge pull request #11562 from druiz17/fix-release-grab

include release message to controller modules
This commit is contained in:
Seth Alves 2017-10-13 13:06:18 -07:00 committed by GitHub
commit fe9f142bf6
4 changed files with 23 additions and 0 deletions

View file

@ -546,6 +546,12 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
Entities.callEntityMethod(this.targetEntityID, "releaseEquip", args);
Messages.sendMessage('Hifi-Object-Manipulation', JSON.stringify({
action: 'release',
grabbedEntity: this.targetEntityID,
joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"
}));
ensureDynamic(this.targetEntityID);
this.targetEntityID = null;
this.messageGrabEntity = false;

View file

@ -144,6 +144,12 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
Entities.deleteAction(this.targetEntityID, this.actionID);
this.actionID = null;
Messages.sendMessage('Hifi-Object-Manipulation', JSON.stringify({
action: 'release',
grabbedEntity: this.targetEntityID,
joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"
}));
this.targetEntityID = null;
};

View file

@ -138,6 +138,11 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
Entities.callEntityMethod(this.targetEntityID, "releaseGrab", args);
Messages.sendMessage('Hifi-Object-Manipulation', JSON.stringify({
action: 'release',
grabbedEntity: this.targetEntityID,
joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"
}));
this.grabbing = false;
this.targetEntityID = null;
};

View file

@ -148,6 +148,12 @@ Script.include("/~/system/libraries/utils.js");
}
}
Messages.sendMessage('Hifi-Object-Manipulation', JSON.stringify({
action: 'release',
grabbedEntity: this.grabbedThingID,
joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"
}));
this.grabbedThingID = null;
};