From f9fa32c2f5b11731c7ba0a0f5631686cb83fab10 Mon Sep 17 00:00:00 2001 From: Alex Shubin Date: Wed, 20 Sep 2023 02:58:50 +0300 Subject: [PATCH 1/2] nre check has been added --- .../Scripts/Grid/ManipulationController.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Assets/MirageXR/Common/Scripts/Grid/ManipulationController.cs b/Assets/MirageXR/Common/Scripts/Grid/ManipulationController.cs index 37f14af32..19064a61f 100644 --- a/Assets/MirageXR/Common/Scripts/Grid/ManipulationController.cs +++ b/Assets/MirageXR/Common/Scripts/Grid/ManipulationController.cs @@ -118,9 +118,12 @@ private void OnManipulationUpdated(GameObject source) return; } - UpdateCopyPosition(source); - SnapToGrid(_copy); - UpdateGridLines(_copy); + if (_copy) + { + UpdateCopyPosition(source); + SnapToGrid(_copy); + UpdateGridLines(_copy); + } } private void OnManipulationEnded(GameObject source) @@ -276,8 +279,11 @@ private void HideGridLines() private void UpdateCopyPosition(GameObject source) { - _copy.SetPose(source.GetPose()); - _copy.transform.localScale = source.transform.lossyScale; + if (_copy) + { + _copy.SetPose(source.GetPose()); + _copy.transform.localScale = source.transform.lossyScale; + } } private void HideCopy() From ef92906c75c58350b568428597c71ab39170566e Mon Sep 17 00:00:00 2001 From: Alex Shubin Date: Wed, 20 Sep 2023 02:59:13 +0300 Subject: [PATCH 2/2] ghost rotation fix --- .../ActionDetailView/Annotation Editors/GhostRecorder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/MirageXR/Common/Scripts/CombinedEditor/ActionDetailView/Annotation Editors/GhostRecorder.cs b/Assets/MirageXR/Common/Scripts/CombinedEditor/ActionDetailView/Annotation Editors/GhostRecorder.cs index e868374bb..8d9546599 100644 --- a/Assets/MirageXR/Common/Scripts/CombinedEditor/ActionDetailView/Annotation Editors/GhostRecorder.cs +++ b/Assets/MirageXR/Common/Scripts/CombinedEditor/ActionDetailView/Annotation Editors/GhostRecorder.cs @@ -157,7 +157,7 @@ private static Pose CreateLocalPose(Transform anchor, Vector3 position, Quaterni return new Pose { position = anchor.InverseTransformPoint(position), - rotation = Quaternion.Inverse(anchor.parent.localRotation) * rotation, + rotation = Quaternion.Inverse(anchor.localRotation) * rotation, }; }