diff --git a/examples/grab.js b/examples/grab.js index 8857b5f611..2134616f89 100644 --- a/examples/grab.js +++ b/examples/grab.js @@ -383,7 +383,16 @@ Grabber.prototype.pressEvent = function(event) { if(!entityIsGrabbedByOther(this.entityID)){ this.moveEvent(event); } - + + var args = "mouse"; + Entities.callEntityMethod(this.entityID, "startDistanceGrab", args); + + Messages.sendMessage('Hifi-Object-Manipulation', JSON.stringify({ + action: 'grab', + grabbedEntity: this.entityID + })); + + // TODO: play sounds again when we aren't leaking AudioInjector threads //Audio.playSound(grabSound, { position: entityProperties.position, volume: VOLUME }); } @@ -401,6 +410,16 @@ Grabber.prototype.releaseEvent = function(event) { beacon.disable(); + var args = "mouse"; + Entities.callEntityMethod(this.entityID, "releaseGrab", args); + + Messages.sendMessage('Hifi-Object-Manipulation', JSON.stringify({ + action: 'release', + grabbedEntity: this.entityID, + joint: "mouse" + })); + + // TODO: play sounds again when we aren't leaking AudioInjector threads //Audio.playSound(releaseSound, { position: entityProperties.position, volume: VOLUME }); }