mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:01:18 +02:00
changing check for near grabbing modules - fixes grabbing for dynamic
This commit is contained in:
parent
045ac4cb0d
commit
b9f0af63e1
1 changed files with 13 additions and 6 deletions
|
@ -49,12 +49,19 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
nearGrabName = this.hand === RIGHT_HAND ? "RightNearParentingGrabEntity" : "LeftNearParentingGrabEntity";
|
nearGrabName = this.hand === RIGHT_HAND ? "RightNearParentingGrabEntity" : "LeftNearParentingGrabEntity";
|
||||||
nearGrabModule = getEnabledModuleByName(nearGrabName);
|
nearGrabModule = getEnabledModuleByName(nearGrabName);
|
||||||
if (nearGrabModule && nearGrabModule.isReady(controllerData)) {
|
if (nearGrabModule && nearGrabModule.isReady(controllerData)) {
|
||||||
return nearGrabModule.isReady(controllerData).active;
|
// check for if near parent module is active.
|
||||||
}
|
var isNearGrabModuleActive = nearGrabModule.isReady(controllerData).active;
|
||||||
nearGrabName = this.hand === RIGHT_HAND ? "RightNearActionGrabEntity" : "LeftNearActionGrabEntity";
|
if (isNearGrabModuleActive) {
|
||||||
nearGrabModule = getEnabledModuleByName(nearGrabName);
|
// if true, return true.
|
||||||
if (nearGrabModule && nearGrabModule.isReady(controllerData)) {
|
return isNearGrabModuleActive;
|
||||||
return nearGrabModule.isReady(controllerData).active;
|
} else {
|
||||||
|
// check near action grab entity as a second pass.
|
||||||
|
nearGrabName = this.hand === RIGHT_HAND ? "RightNearActionGrabEntity" : "LeftNearActionGrabEntity";
|
||||||
|
nearGrabModule = getEnabledModuleByName(nearGrabName);
|
||||||
|
if (nearGrabModule && nearGrabModule.isReady(controllerData)) {
|
||||||
|
return nearGrabModule.isReady(controllerData).active;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue