hide/show grab point sphere only when in a grabbable entity

This commit is contained in:
Brad Hefta-Gaub 2016-10-11 16:22:42 -07:00
parent 93d9cf7917
commit e1a3bc7d55

View file

@ -1075,12 +1075,6 @@ function MyController(hand) {
var controllerLocation = getControllerWorldLocation(this.handToController(), true);
var worldHandPosition = controllerLocation.position;
if (controllerLocation.valid) {
this.grabPointSphereOn();
} else {
this.grabPointSphereOff();
}
var candidateEntities = Entities.findEntities(worldHandPosition, MAX_EQUIP_HOTSPOT_RADIUS);
entityPropertiesCache.addEntities(candidateEntities);
var potentialEquipHotspot = this.chooseBestEquipHotspot(candidateEntities);
@ -1103,9 +1097,11 @@ function MyController(hand) {
if (!this.grabPointIntersectsEntity) {
Controller.triggerHapticPulse(1, 20, this.hand);
this.grabPointIntersectsEntity = true;
this.grabPointSphereOn();
}
} else {
this.grabPointIntersectsEntity = false;
this.grabPointSphereOff();
}
};
@ -1427,12 +1423,6 @@ function MyController(hand) {
var controllerLocation = getControllerWorldLocation(this.handToController(), true);
var handPosition = controllerLocation.position;
if (controllerLocation.valid) {
this.grabPointSphereOn();
} else {
this.grabPointSphereOff();
}
var rayPickInfo = this.calcRayPickInfo(this.hand);
if (rayPickInfo.entityID) {