mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 20:11:13 +02:00
hide/show grab point sphere only when in a grabbable entity
This commit is contained in:
parent
93d9cf7917
commit
e1a3bc7d55
1 changed files with 2 additions and 12 deletions
|
@ -1075,12 +1075,6 @@ function MyController(hand) {
|
||||||
var controllerLocation = getControllerWorldLocation(this.handToController(), true);
|
var controllerLocation = getControllerWorldLocation(this.handToController(), true);
|
||||||
var worldHandPosition = controllerLocation.position;
|
var worldHandPosition = controllerLocation.position;
|
||||||
|
|
||||||
if (controllerLocation.valid) {
|
|
||||||
this.grabPointSphereOn();
|
|
||||||
} else {
|
|
||||||
this.grabPointSphereOff();
|
|
||||||
}
|
|
||||||
|
|
||||||
var candidateEntities = Entities.findEntities(worldHandPosition, MAX_EQUIP_HOTSPOT_RADIUS);
|
var candidateEntities = Entities.findEntities(worldHandPosition, MAX_EQUIP_HOTSPOT_RADIUS);
|
||||||
entityPropertiesCache.addEntities(candidateEntities);
|
entityPropertiesCache.addEntities(candidateEntities);
|
||||||
var potentialEquipHotspot = this.chooseBestEquipHotspot(candidateEntities);
|
var potentialEquipHotspot = this.chooseBestEquipHotspot(candidateEntities);
|
||||||
|
@ -1103,9 +1097,11 @@ function MyController(hand) {
|
||||||
if (!this.grabPointIntersectsEntity) {
|
if (!this.grabPointIntersectsEntity) {
|
||||||
Controller.triggerHapticPulse(1, 20, this.hand);
|
Controller.triggerHapticPulse(1, 20, this.hand);
|
||||||
this.grabPointIntersectsEntity = true;
|
this.grabPointIntersectsEntity = true;
|
||||||
|
this.grabPointSphereOn();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.grabPointIntersectsEntity = false;
|
this.grabPointIntersectsEntity = false;
|
||||||
|
this.grabPointSphereOff();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1427,12 +1423,6 @@ function MyController(hand) {
|
||||||
var controllerLocation = getControllerWorldLocation(this.handToController(), true);
|
var controllerLocation = getControllerWorldLocation(this.handToController(), true);
|
||||||
var handPosition = controllerLocation.position;
|
var handPosition = controllerLocation.position;
|
||||||
|
|
||||||
if (controllerLocation.valid) {
|
|
||||||
this.grabPointSphereOn();
|
|
||||||
} else {
|
|
||||||
this.grabPointSphereOff();
|
|
||||||
}
|
|
||||||
|
|
||||||
var rayPickInfo = this.calcRayPickInfo(this.hand);
|
var rayPickInfo = this.calcRayPickInfo(this.hand);
|
||||||
|
|
||||||
if (rayPickInfo.entityID) {
|
if (rayPickInfo.entityID) {
|
||||||
|
|
Loading…
Reference in a new issue