mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 04:03:35 +02:00
pre PR adjustments
This commit is contained in:
parent
4446ef853f
commit
0f2679b725
1 changed files with 13 additions and 9 deletions
|
@ -21,8 +21,6 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
|
||||||
|
|
||||||
var DEFAULT_SPHERE_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/equip-Fresnel-3.fbx";
|
var DEFAULT_SPHERE_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/equip-Fresnel-3.fbx";
|
||||||
var EQUIP_SPHERE_SCALE_FACTOR = 0.65;
|
var EQUIP_SPHERE_SCALE_FACTOR = 0.65;
|
||||||
var EMPTY_PARENT_ID = "{00000000-0000-0000-0000-000000000000}";
|
|
||||||
var UNEQUIP_KEY = "u";
|
|
||||||
|
|
||||||
|
|
||||||
// Each overlayInfoSet describes a single equip hotspot.
|
// Each overlayInfoSet describes a single equip hotspot.
|
||||||
|
@ -177,9 +175,13 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
var TRIGGER_SMOOTH_RATIO = 0.1; // Time averaging of trigger - 0.0 disables smoothing
|
var TRIGGER_SMOOTH_RATIO = 0.1; // Time averaging of trigger - 0.0 disables smoothing
|
||||||
var TRIGGER_OFF_VALUE = 0.1;
|
var TRIGGER_OFF_VALUE = 0.1;
|
||||||
var TRIGGER_ON_VALUE = TRIGGER_OFF_VALUE + 0.05; // Squeezed just enough to activate search or near grab
|
var TRIGGER_ON_VALUE = TRIGGER_OFF_VALUE + 0.05; // Squeezed just enough to activate search or near grab
|
||||||
var BUMPER_ON_VALUE = 0.5
|
var BUMPER_ON_VALUE = 0.5;
|
||||||
|
|
||||||
|
var EMPTY_PARENT_ID = "{00000000-0000-0000-0000-000000000000}";
|
||||||
|
|
||||||
|
var UNEQUIP_KEY = "u";
|
||||||
|
|
||||||
|
|
||||||
function getWearableData(props) {
|
function getWearableData(props) {
|
||||||
var wearable = {};
|
var wearable = {};
|
||||||
try {
|
try {
|
||||||
|
@ -564,7 +566,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
parentID: Uuid.NULL,
|
parentID: Uuid.NULL,
|
||||||
parentJointIndex: -1
|
parentJointIndex: -1
|
||||||
});
|
});
|
||||||
;
|
|
||||||
var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
|
var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
|
||||||
Entities.callEntityMethod(this.targetEntityID, "releaseEquip", args);
|
Entities.callEntityMethod(this.targetEntityID, "releaseEquip", args);
|
||||||
|
|
||||||
|
@ -780,14 +782,14 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
var actionID = actionIDs[actionIndex];
|
var actionID = actionIDs[actionIndex];
|
||||||
var actionArguments = Entities.getActionArguments(entityID, actionID);
|
var actionArguments = Entities.getActionArguments(entityID, actionID);
|
||||||
var tag = actionArguments.tag;
|
var tag = actionArguments.tag;
|
||||||
if (tag.slice(0, 5) == "grab-") {
|
if (tag.slice(0, 5) === "grab-") {
|
||||||
Entities.deleteAction(entityID, actionID);
|
Entities.deleteAction(entityID, actionID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var onMousePress = function(event) {
|
var onMousePress = function(event) {
|
||||||
if (isInEditMode()) { // ignore any mouse clicks on the entity while create/edit is open
|
if (isInEditMode()) { // don't consider any mouse clicks on the entity while in edit
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var pickRay = Camera.computePickRay(event.x, event.y);
|
var pickRay = Camera.computePickRay(event.x, event.y);
|
||||||
|
@ -804,9 +806,11 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
var rightHandAvailable = rightEquipEntity.targetEntityID === null;
|
var rightHandAvailable = rightEquipEntity.targetEntityID === null;
|
||||||
var mouseEquip = true;
|
var mouseEquip = true;
|
||||||
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)
|
||||||
clearGrabActions(intersection.entityID);
|
clearGrabActions(intersection.entityID);
|
||||||
rightEquipEntity.setMessageGrabData(entityProperties, mouseEquip);
|
rightEquipEntity.setMessageGrabData(entityProperties, mouseEquip);
|
||||||
} 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)
|
||||||
clearGrabActions(intersection.entityID);
|
clearGrabActions(intersection.entityID);
|
||||||
leftEquipEntity.setMessageGrabData(entityProperties, mouseEquip);
|
leftEquipEntity.setMessageGrabData(entityProperties, mouseEquip);
|
||||||
}
|
}
|
||||||
|
@ -824,7 +828,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Messages.subscribe('Hifi-Hand-Grab');
|
Messages.subscribe('Hifi-Hand-Grab');
|
||||||
Messages.subscribe('Hifi-Hand-Drop');
|
Messages.subscribe('Hifi-Hand-Drop');
|
||||||
Messages.messageReceived.connect(handleMessage);
|
Messages.messageReceived.connect(handleMessage);
|
||||||
|
|
Loading…
Reference in a new issue