From 374cc8183bffa7d1b0f51bb009db03fe7f98449e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Je=CC=81re=CC=81my=20Lacoche?= <jeremy.lacoche@orange.com>
Date: Sun, 2 Mar 2025 21:32:54 +0100
Subject: [PATCH] Important fix : wrong way to manage reloc information. In
 case of multiple possible trackables only the first one was taken into
 account

---
 Runtime/Scripts/WorldAnalysisARFoundation.cs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Runtime/Scripts/WorldAnalysisARFoundation.cs b/Runtime/Scripts/WorldAnalysisARFoundation.cs
index 0292ec0..cb2abda 100644
--- a/Runtime/Scripts/WorldAnalysisARFoundation.cs
+++ b/Runtime/Scripts/WorldAnalysisARFoundation.cs
@@ -157,7 +157,6 @@ public class WorldAnalysisARFoundation : MonoBehaviour, WorldAnalysisInterface
             foreach (KeyValuePair<Guid, SubscriptionInfo> subPose in m_subscriptionsPoses)
             {
                 RelocalizationInformation information = m_relocalizationInformations[subPose.Value.uuidTarget];
-                RelocObjects firstRelocInfo = information.RelocObjects.First();
                 Dictionary<Guid, RelocObjects> temp = information.RelocObjects.ToDictionary(relocObject => relocObject.Trackable.UUID, relocObject => relocObject);
 
                 /// Trackable selection
@@ -234,8 +233,9 @@ public class WorldAnalysisARFoundation : MonoBehaviour, WorldAnalysisInterface
                         // For now we just ignore it : we could also send not tracked todo
                         continue;
                     }
-
-                    Matrix4x4 tr = WorldStorageUnityHelper.ConvertETSIARFTransform3DToUnity(firstRelocInfo.Transform3D);  // Changed to WS / SylR
+                    
+                    Matrix4x4 tr = WorldStorageUnityHelper.ConvertETSIARFTransform3DToUnity(temp[bestTrackableCandidateID].Transform3D);  // Changed to WS / SylR
+  
                     UnityEngine.Vector3 tr_trans = WorldAnalysisUnityHelper.ExtractTranslationFromMatrix(tr);
                     UnityEngine.Quaternion tr_rot = WorldAnalysisUnityHelper.ExtractRotationFromMatrix(tr);
 
-- 
GitLab