Improve reliability of hand lasers; increase size of target

This commit is contained in:
Zach Fox 2017-07-19 17:07:57 -07:00
parent 4374d4d1e5
commit 2dc3844116
2 changed files with 11 additions and 8 deletions

View file

@ -52,7 +52,7 @@ void ContextOverlayInterface::createOrDestroyContextOverlay(const EntityItemID&
_contextOverlayID = qApp->getOverlays().addOverlay(_contextOverlay);
}
_contextOverlay->setDimensions(glm::vec2(0.05f, 0.05f) * glm::distance(entityProperties.getPosition(), qApp->getCamera().getPosition()));
_contextOverlay->setDimensions(glm::vec2(0.1f, 0.1f) * glm::distance(entityProperties.getPosition(), qApp->getCamera().getPosition()));
_contextOverlay->setPosition(entityProperties.getPosition());
_contextOverlay->setRotation(entityProperties.getRotation());
_contextOverlay->setVisible(true);

View file

@ -187,6 +187,7 @@ var DEFAULT_GRABBABLE_DATA = {
var USE_BLACKLIST = true;
var blacklist = [];
var potentialEntityWithContextOverlay = false;
var entityWithContextOverlay = false;
var contextualHand = -1;
@ -2221,13 +2222,13 @@ function MyController(hand) {
entityPropertiesCache.addEntity(rayPickInfo.entityID);
}
if (rayPickInfo.entityID && (entityWithContextOverlay !== rayPickInfo.entityID)) {
if (entityWithContextOverlay) {
ContextOverlay.destroyContextOverlay(entityWithContextOverlay);
entityWithContextOverlay = false;
}
if (rayPickInfo.entityID && !entityWithContextOverlay) {
Script.setTimeout(function () {
if (rayPickInfo.entityID === entityWithContextOverlay && contextualHand !== -1) {
if (rayPickInfo.entityID === potentialEntityWithContextOverlay &&
!entityWithContextOverlay
&& contextualHand !== -1) {
entityWithContextOverlay = rayPickInfo.entityID;
potentialEntityWithContextOverlay = false;
var pointerEvent = {
type: "Move",
id: contextualHand + 1, // 0 is reserved for hardware mouse
@ -2240,8 +2241,8 @@ function MyController(hand) {
ContextOverlay.createOrDestroyContextOverlay(rayPickInfo.entityID, pointerEvent);
}
}, 500);
entityWithContextOverlay = rayPickInfo.entityID;
contextualHand = this.hand;
potentialEntityWithContextOverlay = rayPickInfo.entityID;
}
var candidateHotSpotEntities = Entities.findEntities(handPosition, MAX_EQUIP_HOTSPOT_RADIUS);
@ -3492,6 +3493,7 @@ function MyController(hand) {
if (entityWithContextOverlay) {
ContextOverlay.destroyContextOverlay(entityWithContextOverlay);
entityWithContextOverlay = false;
potentialEntityWithContextOverlay = false;
}
if (isInEditMode()) {
@ -3631,6 +3633,7 @@ function MyController(hand) {
Overlays.sendMousePressOnOverlay(this.grabbedOverlay, pointerEvent);
entityWithContextOverlay = false;
potentialEntityWithContextOverlay = false;
this.touchingEnterTimer = 0;
this.touchingEnterPointerEvent = pointerEvent;