mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 06:10:52 +02:00
Merge pull request #11467 from sethalves/fix-near-trigger
Fix near trigger
This commit is contained in:
commit
f384cde471
1 changed files with 8 additions and 4 deletions
|
@ -26,6 +26,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
this.previousParentID = {};
|
this.previousParentID = {};
|
||||||
this.previousParentJointIndex = {};
|
this.previousParentJointIndex = {};
|
||||||
this.previouslyUnhooked = {};
|
this.previouslyUnhooked = {};
|
||||||
|
this.startSent = false;
|
||||||
|
|
||||||
this.parameters = makeDispatcherModuleParameters(
|
this.parameters = makeDispatcherModuleParameters(
|
||||||
520,
|
520,
|
||||||
|
@ -76,7 +77,6 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
var targetProps = this.getTargetProps(controllerData);
|
var targetProps = this.getTargetProps(controllerData);
|
||||||
if (targetProps) {
|
if (targetProps) {
|
||||||
this.targetEntityID = targetProps.id;
|
this.targetEntityID = targetProps.id;
|
||||||
this.startNearTrigger(controllerData);
|
|
||||||
return makeRunningValues(true, [this.targetEntityID], []);
|
return makeRunningValues(true, [this.targetEntityID], []);
|
||||||
} else {
|
} else {
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
|
@ -84,12 +84,16 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
};
|
};
|
||||||
|
|
||||||
this.run = function (controllerData) {
|
this.run = function (controllerData) {
|
||||||
if (controllerData.triggerClicks[this.hand] === 0) {
|
if (!this.startSent) {
|
||||||
|
this.startNearTrigger(controllerData);
|
||||||
|
this.startSent = true;
|
||||||
|
} else if (controllerData.triggerValues[this.hand] < TRIGGER_OFF_VALUE) {
|
||||||
this.endNearTrigger(controllerData);
|
this.endNearTrigger(controllerData);
|
||||||
|
this.startSent = false;
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
|
} else {
|
||||||
|
this.continueNearTrigger(controllerData);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.continueNearTrigger(controllerData);
|
|
||||||
return makeRunningValues(true, [this.targetEntityID], []);
|
return makeRunningValues(true, [this.targetEntityID], []);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue