mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 12:54:30 +02:00
Improve reliability of hand lasers; increase size of target
This commit is contained in:
parent
4374d4d1e5
commit
2dc3844116
2 changed files with 11 additions and 8 deletions
|
@ -52,7 +52,7 @@ void ContextOverlayInterface::createOrDestroyContextOverlay(const EntityItemID&
|
||||||
_contextOverlayID = qApp->getOverlays().addOverlay(_contextOverlay);
|
_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->setPosition(entityProperties.getPosition());
|
||||||
_contextOverlay->setRotation(entityProperties.getRotation());
|
_contextOverlay->setRotation(entityProperties.getRotation());
|
||||||
_contextOverlay->setVisible(true);
|
_contextOverlay->setVisible(true);
|
||||||
|
|
|
@ -187,6 +187,7 @@ var DEFAULT_GRABBABLE_DATA = {
|
||||||
var USE_BLACKLIST = true;
|
var USE_BLACKLIST = true;
|
||||||
var blacklist = [];
|
var blacklist = [];
|
||||||
|
|
||||||
|
var potentialEntityWithContextOverlay = false;
|
||||||
var entityWithContextOverlay = false;
|
var entityWithContextOverlay = false;
|
||||||
var contextualHand = -1;
|
var contextualHand = -1;
|
||||||
|
|
||||||
|
@ -2221,13 +2222,13 @@ function MyController(hand) {
|
||||||
entityPropertiesCache.addEntity(rayPickInfo.entityID);
|
entityPropertiesCache.addEntity(rayPickInfo.entityID);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rayPickInfo.entityID && (entityWithContextOverlay !== rayPickInfo.entityID)) {
|
if (rayPickInfo.entityID && !entityWithContextOverlay) {
|
||||||
if (entityWithContextOverlay) {
|
|
||||||
ContextOverlay.destroyContextOverlay(entityWithContextOverlay);
|
|
||||||
entityWithContextOverlay = false;
|
|
||||||
}
|
|
||||||
Script.setTimeout(function () {
|
Script.setTimeout(function () {
|
||||||
if (rayPickInfo.entityID === entityWithContextOverlay && contextualHand !== -1) {
|
if (rayPickInfo.entityID === potentialEntityWithContextOverlay &&
|
||||||
|
!entityWithContextOverlay
|
||||||
|
&& contextualHand !== -1) {
|
||||||
|
entityWithContextOverlay = rayPickInfo.entityID;
|
||||||
|
potentialEntityWithContextOverlay = false;
|
||||||
var pointerEvent = {
|
var pointerEvent = {
|
||||||
type: "Move",
|
type: "Move",
|
||||||
id: contextualHand + 1, // 0 is reserved for hardware mouse
|
id: contextualHand + 1, // 0 is reserved for hardware mouse
|
||||||
|
@ -2240,8 +2241,8 @@ function MyController(hand) {
|
||||||
ContextOverlay.createOrDestroyContextOverlay(rayPickInfo.entityID, pointerEvent);
|
ContextOverlay.createOrDestroyContextOverlay(rayPickInfo.entityID, pointerEvent);
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
entityWithContextOverlay = rayPickInfo.entityID;
|
|
||||||
contextualHand = this.hand;
|
contextualHand = this.hand;
|
||||||
|
potentialEntityWithContextOverlay = rayPickInfo.entityID;
|
||||||
}
|
}
|
||||||
|
|
||||||
var candidateHotSpotEntities = Entities.findEntities(handPosition, MAX_EQUIP_HOTSPOT_RADIUS);
|
var candidateHotSpotEntities = Entities.findEntities(handPosition, MAX_EQUIP_HOTSPOT_RADIUS);
|
||||||
|
@ -3492,6 +3493,7 @@ function MyController(hand) {
|
||||||
if (entityWithContextOverlay) {
|
if (entityWithContextOverlay) {
|
||||||
ContextOverlay.destroyContextOverlay(entityWithContextOverlay);
|
ContextOverlay.destroyContextOverlay(entityWithContextOverlay);
|
||||||
entityWithContextOverlay = false;
|
entityWithContextOverlay = false;
|
||||||
|
potentialEntityWithContextOverlay = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isInEditMode()) {
|
if (isInEditMode()) {
|
||||||
|
@ -3631,6 +3633,7 @@ function MyController(hand) {
|
||||||
|
|
||||||
Overlays.sendMousePressOnOverlay(this.grabbedOverlay, pointerEvent);
|
Overlays.sendMousePressOnOverlay(this.grabbedOverlay, pointerEvent);
|
||||||
entityWithContextOverlay = false;
|
entityWithContextOverlay = false;
|
||||||
|
potentialEntityWithContextOverlay = false;
|
||||||
|
|
||||||
this.touchingEnterTimer = 0;
|
this.touchingEnterTimer = 0;
|
||||||
this.touchingEnterPointerEvent = pointerEvent;
|
this.touchingEnterPointerEvent = pointerEvent;
|
||||||
|
|
Loading…
Reference in a new issue