From d748dbce457dabf6bc46eb22c5c5315f50af159c Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 31 Jul 2018 17:35:42 +0100 Subject: MAINT-8909 Loosen precision when checking rotation and other false negatives when comparing faces to see if they can be considered planar aligned. This was causing fields to be marked tentative (grayed display) incorrectly. --- indra/newview/llselectmgr.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 53f09ab62d..86b88e0a59 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -7936,3 +7936,43 @@ void LLSelectMgr::sendSelectionMove() //saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); } + +bool LLCheckIdenticalFunctor::same(const F32& a, const F32& b, const F32& tolerance) +{ + F32 delta = (a - b); + F32 abs_delta = fabs(delta); + bool is_samish = abs_delta <= tolerance; + if (!is_samish) + { + int q = 0; + q++; + } + return is_samish; +} + +#define DEF_DUMMY_CHECK_FUNCTOR(T) \ +bool LLCheckIdenticalFunctor::same(const T& a, const T& b, const T& tolerance) \ +{ \ + (void)tolerance; \ + return a == b; \ +} + +DEF_DUMMY_CHECK_FUNCTOR(LLUUID) +DEF_DUMMY_CHECK_FUNCTOR(LLGLenum) +DEF_DUMMY_CHECK_FUNCTOR(LLTextureEntry) +DEF_DUMMY_CHECK_FUNCTOR(LLTextureEntry::e_texgen) +DEF_DUMMY_CHECK_FUNCTOR(bool) +DEF_DUMMY_CHECK_FUNCTOR(U8) +DEF_DUMMY_CHECK_FUNCTOR(int) +DEF_DUMMY_CHECK_FUNCTOR(LLColor4) +DEF_DUMMY_CHECK_FUNCTOR(LLMediaEntry) +DEF_DUMMY_CHECK_FUNCTOR(LLPointer) +DEF_DUMMY_CHECK_FUNCTOR(std::string) +DEF_DUMMY_CHECK_FUNCTOR(std::vector) + +bool LLCheckIdenticalFunctor::same(class LLFace* const & a, class LLFace* const & b, class LLFace* const & tolerance) \ +{ \ + (void)tolerance; \ + return a == b; \ +} + -- cgit v1.2.3