From a3f0c80590c4539a376cc395639ece6c1ece210a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Wed, 17 Jul 2024 08:16:42 +0200 Subject: [PATCH] Fix source pose not filtering for source ID --- .../Controllers/BaseControllerVisualizer.cs | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Runtime/Input/Controllers/BaseControllerVisualizer.cs b/Runtime/Input/Controllers/BaseControllerVisualizer.cs index 6c2f5f43..dd2bf525 100644 --- a/Runtime/Input/Controllers/BaseControllerVisualizer.cs +++ b/Runtime/Input/Controllers/BaseControllerVisualizer.cs @@ -44,7 +44,10 @@ public Transform GripPose /// public override void OnSourcePoseChanged(SourcePoseEventData eventData) { - SourcePose = eventData.SourceData; + if (eventData.SourceId == Controller?.InputSource.SourceId) + { + SourcePose = eventData.SourceData; + } if (OverrideSourcePose) { @@ -57,7 +60,10 @@ public override void OnSourcePoseChanged(SourcePoseEventData eventData) /// public override void OnSourcePoseChanged(SourcePoseEventData eventData) { - SourcePose = new Pose(SourcePose.position, eventData.SourceData); + if (eventData.SourceId == Controller?.InputSource.SourceId) + { + SourcePose = new Pose(SourcePose.position, eventData.SourceData); + } if (OverrideSourcePose) { @@ -70,7 +76,10 @@ public override void OnSourcePoseChanged(SourcePoseEventData eventDa /// public override void OnSourcePoseChanged(SourcePoseEventData eventData) { - SourcePose = new Pose(eventData.SourceData, SourcePose.rotation); + if (eventData.SourceId == Controller?.InputSource.SourceId) + { + SourcePose = new Pose(eventData.SourceData, SourcePose.rotation); + } if (OverrideSourcePose) { @@ -83,7 +92,10 @@ public override void OnSourcePoseChanged(SourcePoseEventData eventData) /// public override void OnSourcePoseChanged(SourcePoseEventData eventData) { - SourcePose = new Pose(eventData.SourceData, SourcePose.rotation); + if (eventData.SourceId == Controller?.InputSource.SourceId) + { + SourcePose = new Pose(eventData.SourceData, SourcePose.rotation); + } if (OverrideSourcePose) {