mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 18:35:04 +02:00
grab script calls startDistanceGrab and releaseGrab entity methods and sends grab/release messages to Hifi-Object-Manipulation channel
This commit is contained in:
parent
8d45453102
commit
6591329b0c
1 changed files with 20 additions and 1 deletions
|
@ -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 });
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue