mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
use messageGrabEntity flag instead
This commit is contained in:
parent
0ee55a09b6
commit
8f5de7b16a
1 changed files with 1 additions and 10 deletions
|
@ -273,8 +273,6 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
this.shouldSendStart = false;
|
this.shouldSendStart = false;
|
||||||
this.equipedWithSecondary = false;
|
this.equipedWithSecondary = false;
|
||||||
this.handHasBeenRightsideUp = false;
|
this.handHasBeenRightsideUp = false;
|
||||||
this.mouseEquip = false;
|
|
||||||
this.messageEquip = false;
|
|
||||||
|
|
||||||
this.parameters = makeDispatcherModuleParameters(
|
this.parameters = makeDispatcherModuleParameters(
|
||||||
300,
|
300,
|
||||||
|
@ -584,8 +582,6 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
this.targetEntityID = null;
|
this.targetEntityID = null;
|
||||||
this.messageGrabEntity = false;
|
this.messageGrabEntity = false;
|
||||||
this.grabEntityProps = null;
|
this.grabEntityProps = null;
|
||||||
this.mouseEquip = false;
|
|
||||||
this.messageEquip = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.updateInputs = function (controllerData) {
|
this.updateInputs = function (controllerData) {
|
||||||
|
@ -631,14 +627,12 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
|
|
||||||
// if the potentialHotspot is cloneable, clone it and return it
|
// if the potentialHotspot is cloneable, clone it and return it
|
||||||
// if the potentialHotspot os not cloneable and locked return null
|
// if the potentialHotspot os not cloneable and locked return null
|
||||||
|
|
||||||
if (potentialEquipHotspot &&
|
if (potentialEquipHotspot &&
|
||||||
(((this.triggerSmoothedSqueezed() || this.secondarySmoothedSqueezed()) && !this.waitForTriggerRelease) ||
|
(((this.triggerSmoothedSqueezed() || this.secondarySmoothedSqueezed()) && !this.waitForTriggerRelease) ||
|
||||||
this.messageGrabEntity)) {
|
this.messageGrabEntity)) {
|
||||||
this.grabbedHotspot = potentialEquipHotspot;
|
this.grabbedHotspot = potentialEquipHotspot;
|
||||||
this.targetEntityID = this.grabbedHotspot.entityID;
|
this.targetEntityID = this.grabbedHotspot.entityID;
|
||||||
this.startEquipEntity(controllerData);
|
this.startEquipEntity(controllerData);
|
||||||
this.messageGrabEntity = false;
|
|
||||||
this.equipedWithSecondary = this.secondarySmoothedSqueezed();
|
this.equipedWithSecondary = this.secondarySmoothedSqueezed();
|
||||||
return makeRunningValues(true, [potentialEquipHotspot.entityID], []);
|
return makeRunningValues(true, [potentialEquipHotspot.entityID], []);
|
||||||
} else {
|
} else {
|
||||||
|
@ -662,7 +656,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
var timestamp = Date.now();
|
var timestamp = Date.now();
|
||||||
this.updateInputs(controllerData);
|
this.updateInputs(controllerData);
|
||||||
|
|
||||||
if (!this.mouseEquip && !this.messageEquip && !this.isTargetIDValid(controllerData)) {
|
if (!this.messageGrabEntity && !this.isTargetIDValid(controllerData)) {
|
||||||
this.endEquipEntity();
|
this.endEquipEntity();
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
}
|
}
|
||||||
|
@ -763,7 +757,6 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
var equipModule = (data.hand === "left") ? leftEquipEntity : rightEquipEntity;
|
var equipModule = (data.hand === "left") ? leftEquipEntity : rightEquipEntity;
|
||||||
var entityProperties = Entities.getEntityProperties(data.entityID, DISPATCHER_PROPERTIES);
|
var entityProperties = Entities.getEntityProperties(data.entityID, DISPATCHER_PROPERTIES);
|
||||||
entityProperties.id = data.entityID;
|
entityProperties.id = data.entityID;
|
||||||
equipModule.messageEquip = true;
|
|
||||||
equipModule.setMessageGrabData(entityProperties);
|
equipModule.setMessageGrabData(entityProperties);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("WARNING: equipEntity.js -- error parsing Hifi-Hand-Grab message: " + message);
|
print("WARNING: equipEntity.js -- error parsing Hifi-Hand-Grab message: " + message);
|
||||||
|
@ -815,12 +808,10 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
if (rightHandAvailable && (distanceToRightHand < distanceToLeftHand || !leftHandAvailable)) {
|
if (rightHandAvailable && (distanceToRightHand < distanceToLeftHand || !leftHandAvailable)) {
|
||||||
// clear any existing grab actions on the entity now (their later removal could affect bootstrapping flags)
|
// clear any existing grab actions on the entity now (their later removal could affect bootstrapping flags)
|
||||||
clearGrabActions(entityID);
|
clearGrabActions(entityID);
|
||||||
rightEquipEntity.mouseEquip = true;
|
|
||||||
rightEquipEntity.setMessageGrabData(entityProperties);
|
rightEquipEntity.setMessageGrabData(entityProperties);
|
||||||
} else if (leftHandAvailable && (distanceToLeftHand < distanceToRightHand || !rightHandAvailable)) {
|
} else if (leftHandAvailable && (distanceToLeftHand < distanceToRightHand || !rightHandAvailable)) {
|
||||||
// clear any existing grab actions on the entity now (their later removal could affect bootstrapping flags)
|
// clear any existing grab actions on the entity now (their later removal could affect bootstrapping flags)
|
||||||
clearGrabActions(entityID);
|
clearGrabActions(entityID);
|
||||||
leftEquipEntity.mouseEquip = true;
|
|
||||||
leftEquipEntity.setMessageGrabData(entityProperties);
|
leftEquipEntity.setMessageGrabData(entityProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue