mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Fixes the handControllerGrab Hifi-Hand-Grab
message. Was broken since the hotspot changes to handControllerGrab.js.
This commit is contained in:
parent
a9c6d69aa6
commit
3a2b0ffa08
1 changed files with 13 additions and 2 deletions
|
@ -1267,7 +1267,7 @@ function MyController(hand) {
|
||||||
if (this.triggerSmoothedGrab()) {
|
if (this.triggerSmoothedGrab()) {
|
||||||
this.grabbedHotspot = potentialEquipHotspot;
|
this.grabbedHotspot = potentialEquipHotspot;
|
||||||
this.grabbedEntity = potentialEquipHotspot.entityID;
|
this.grabbedEntity = potentialEquipHotspot.entityID;
|
||||||
this.setState(STATE_HOLD, "eqipping '" + entityPropertiesCache.getProps(this.grabbedEntity).name + "'");
|
this.setState(STATE_HOLD, "equipping '" + entityPropertiesCache.getProps(this.grabbedEntity).name + "'");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2354,9 +2354,20 @@ var handleHandMessages = function(channel, message, sender) {
|
||||||
try {
|
try {
|
||||||
data = JSON.parse(message);
|
data = JSON.parse(message);
|
||||||
var selectedController = (data.hand === 'left') ? leftController : rightController;
|
var selectedController = (data.hand === 'left') ? leftController : rightController;
|
||||||
|
var hotspotIndex = data.hotspotIndex !== undefined ? parseInt(data.hotspotIndex) : 0;
|
||||||
selectedController.release();
|
selectedController.release();
|
||||||
|
var wearableEntity = data.entityID;
|
||||||
|
entityPropertiesCache.addEntity(wearableEntity);
|
||||||
|
selectedController.grabbedEntity = wearableEntity;
|
||||||
|
var hotspots = selectedController.collectEquipHotspots(selectedController.grabbedEntity);
|
||||||
|
if (hotspots.length > 0) {
|
||||||
|
if (hotspotIndex >= hotspots.length) {
|
||||||
|
hotspotIndex = 0;
|
||||||
|
}
|
||||||
|
selectedController.grabbedHotspot = hotspots[hotspotIndex];
|
||||||
|
}
|
||||||
selectedController.setState(STATE_HOLD, "Hifi-Hand-Grab msg received");
|
selectedController.setState(STATE_HOLD, "Hifi-Hand-Grab msg received");
|
||||||
selectedController.grabbedEntity = data.entityID;
|
selectedController.nearGrabbingEnter();
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("WARNING: error parsing Hifi-Hand-Grab message");
|
print("WARNING: error parsing Hifi-Hand-Grab message");
|
||||||
|
|
Loading…
Reference in a new issue