From 4e14bd2396f57634dbc9a713dce8fca4d640086d Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Thu, 5 Sep 2024 22:19:54 +0800 Subject: [PATCH] fix: ignore pick results directly on axis --- thermion_dart/native/include/Gizmo.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/thermion_dart/native/include/Gizmo.hpp b/thermion_dart/native/include/Gizmo.hpp index fd27d03d..21b5127b 100644 --- a/thermion_dart/native/include/Gizmo.hpp +++ b/thermion_dart/native/include/Gizmo.hpp @@ -37,8 +37,11 @@ class Gizmo { void handle(filament::View::PickingQueryResult const &result) { auto x = static_cast(result.fragCoords.x); auto y= static_cast(result.fragCoords.y); - for(int i = 4; i < 7; i++) { + for(int i = 0; i < 7; i++) { if(_gizmo->_entities[i] == result.renderable) { + if(i < 4) { + return; + } _gizmo->highlight(_gizmo->_entities[i - 4]); _callback(Entity::smuggle(_gizmo->_entities[i - 4]), x, y); return; @@ -96,9 +99,9 @@ class Gizmo { Material* _material; MaterialInstance* _materialInstances[7]; math::float4 inactiveColors[3] { - math::float4 { 0.75f, 0.0f, 0.0f, 1.0f }, - math::float4 { 0.0f, 0.75f, 0.0f, 1.0f }, - math::float4 { 0.0f, 0.0f, 0.75f, 1.0f }, + math::float4 { 1.0f, 0.0f, 0.0f, 0.5f }, + math::float4 { 0.0f, 1.0f, 0.0f, 0.5f }, + math::float4 { 0.0f, 0.0f, 1.0f, 0.5f }, }; math::float4 activeColors[3] { math::float4 { 1.0f, 0.0f, 0.0f, 1.0f },