mirror of
https://github.com/overte-org/overte.git
synced 2025-07-14 15:16:38 +02:00
add entityIsEquipped utils for grab.js check
This commit is contained in:
parent
4a08a6c147
commit
07fb604090
2 changed files with 9 additions and 1 deletions
|
@ -567,7 +567,7 @@ Grabber.prototype.moveEventProcess = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.actionID) {
|
if (!this.actionID) {
|
||||||
if (!entityIsGrabbedByOther(this.entityID) && Entities.getEntityProperties(this.entityID, ['parentID']).parentID !== MyAvatar.SELF_ID) {
|
if (!entityIsGrabbedByOther(this.entityID) && !entityIsEquipped(this.entityID)) {
|
||||||
this.actionID = Entities.addAction("far-grab", this.entityID, actionArgs);
|
this.actionID = Entities.addAction("far-grab", this.entityID, actionArgs);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -384,6 +384,14 @@ distanceBetweenPointAndEntityBoundingBox = function(point, entityProps) {
|
||||||
return Vec3.distance(v, localPoint);
|
return Vec3.distance(v, localPoint);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
entityIsEquipped = function(entityID) {
|
||||||
|
var rightEquipEntity = getEnabledModuleByName("RightEquipEntity");
|
||||||
|
var leftEquipEntity = getEnabledModuleByName("LeftEquipEntity");
|
||||||
|
var equippedInRightHand = rightEquipEntity ? rightEquipEntity.targetEntityID === entityID : false;
|
||||||
|
var equippedInLeftHand = leftEquipEntity ? leftEquipEntity.targetEntityID === entityID : false;
|
||||||
|
return equippedInRightHand || equippedInLeftHand;
|
||||||
|
};
|
||||||
|
|
||||||
if (typeof module !== 'undefined') {
|
if (typeof module !== 'undefined') {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
makeDispatcherModuleParameters: makeDispatcherModuleParameters,
|
makeDispatcherModuleParameters: makeDispatcherModuleParameters,
|
||||||
|
|
Loading…
Reference in a new issue