mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +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";
|
||||
nearGrabModule = getEnabledModuleByName(nearGrabName);
|
||||
if (nearGrabModule && nearGrabModule.isReady(controllerData)) {
|
||||
return nearGrabModule.isReady(controllerData).active;
|
||||
}
|
||||
nearGrabName = this.hand === RIGHT_HAND ? "RightNearActionGrabEntity" : "LeftNearActionGrabEntity";
|
||||
nearGrabModule = getEnabledModuleByName(nearGrabName);
|
||||
if (nearGrabModule && nearGrabModule.isReady(controllerData)) {
|
||||
return nearGrabModule.isReady(controllerData).active;
|
||||
// check for if near parent module is active.
|
||||
var isNearGrabModuleActive = nearGrabModule.isReady(controllerData).active;
|
||||
if (isNearGrabModuleActive) {
|
||||
// if true, return true.
|
||||
return isNearGrabModuleActive;
|
||||
} 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;
|
||||
|
|
Loading…
Reference in a new issue