Updates to behavior and shader appearance

This commit is contained in:
Zach Fox 2017-09-22 11:24:30 -07:00
parent 57b5a23373
commit bb9db3ef6d
3 changed files with 14 additions and 7 deletions

View file

@ -82,6 +82,10 @@ void ContextOverlayInterface::setEnabled(bool enabled) {
bool ContextOverlayInterface::createOrDestroyContextOverlay(const EntityItemID& entityItemID, const PointerEvent& event) { bool ContextOverlayInterface::createOrDestroyContextOverlay(const EntityItemID& entityItemID, const PointerEvent& event) {
if (_enabled && event.getButton() == PointerEvent::SecondaryButton) { if (_enabled && event.getButton() == PointerEvent::SecondaryButton) {
if (contextOverlayFilterPassed(entityItemID)) { if (contextOverlayFilterPassed(entityItemID)) {
if (event.getID() == 0) {
enableEntityHighlight(entityItemID);
}
qCDebug(context_overlay) << "Creating Context Overlay on top of entity with ID: " << entityItemID; qCDebug(context_overlay) << "Creating Context Overlay on top of entity with ID: " << entityItemID;
// Add all necessary variables to the stack // Add all necessary variables to the stack
@ -165,6 +169,7 @@ bool ContextOverlayInterface::createOrDestroyContextOverlay(const EntityItemID&
} }
} else { } else {
if (!_currentEntityWithContextOverlay.isNull()) { if (!_currentEntityWithContextOverlay.isNull()) {
disableEntityHighlight(_currentEntityWithContextOverlay);
return destroyContextOverlay(_currentEntityWithContextOverlay, event); return destroyContextOverlay(_currentEntityWithContextOverlay, event);
} }
return false; return false;
@ -226,13 +231,13 @@ void ContextOverlayInterface::contextOverlays_hoverLeaveOverlay(const OverlayID&
} }
void ContextOverlayInterface::contextOverlays_hoverEnterEntity(const EntityItemID& entityID, const PointerEvent& event) { void ContextOverlayInterface::contextOverlays_hoverEnterEntity(const EntityItemID& entityID, const PointerEvent& event) {
if (contextOverlayFilterPassed(entityID) && _enabled) { if (contextOverlayFilterPassed(entityID) && _enabled && event.getID() != 0) {
enableEntityHighlight(entityID); enableEntityHighlight(entityID);
} }
} }
void ContextOverlayInterface::contextOverlays_hoverLeaveEntity(const EntityItemID& entityID, const PointerEvent& event) { void ContextOverlayInterface::contextOverlays_hoverLeaveEntity(const EntityItemID& entityID, const PointerEvent& event) {
if (_currentEntityWithContextOverlay != entityID && _enabled) { if (_currentEntityWithContextOverlay != entityID && _enabled && event.getID() != 0) {
disableEntityHighlight(entityID); disableEntityHighlight(entityID);
} }
} }

View file

@ -81,10 +81,10 @@ public:
float getColorB() const { return color.b; } float getColorB() const { return color.b; }
glm::vec3 color{ 1.f, 0.7f, 0.2f }; glm::vec3 color{ 1.f, 0.7f, 0.2f };
float width{ 3.f }; float width{ 1.5f };
float intensity{ 1.f }; float intensity{ 0.9f };
float fillOpacityUnoccluded{ 0.35f }; float fillOpacityUnoccluded{ 0.0f };
float fillOpacityOccluded{ 0.1f }; float fillOpacityOccluded{ 0.0f };
bool glow{ false }; bool glow{ false };
signals: signals:

View file

@ -148,7 +148,9 @@ Script.include("/~/system/libraries/controllers.js");
if (mode === "full") { if (mode === "full") {
var fullEndToEdit = PICK_WITH_HAND_RAY ? this.fullEnd : fullEnd; var fullEndToEdit = PICK_WITH_HAND_RAY ? this.fullEnd : fullEnd;
fullEndToEdit.dimensions = dim; fullEndToEdit.dimensions = dim;
LaserPointers.editRenderState(laserPointerID, mode, {path: fullPath, end: fullEndToEdit}); LaserPointers.editRenderState(laserPointerID, mode, { path: fullPath, end: fullEndToEdit });
this.contextOverlayTimer = false;
this.destroyContextOverlay();
} else if (mode === "half") { } else if (mode === "half") {
var halfEndToEdit = PICK_WITH_HAND_RAY ? this.halfEnd : halfEnd; var halfEndToEdit = PICK_WITH_HAND_RAY ? this.halfEnd : halfEnd;
halfEndToEdit.dimensions = dim; halfEndToEdit.dimensions = dim;