grab script calls startDistanceGrab and releaseGrab entity methods and sends grab/release messages to Hifi-Object-Manipulation channel

This commit is contained in:
Seth Alves 2016-04-26 13:04:08 -07:00
parent 8d45453102
commit 6591329b0c

View file

@ -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 });
}