Skip to content

Commit 9eb5771

Browse files
committed
Ensure we transform from the playspace pose
1 parent a0b9806 commit 9eb5771

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

org.mixedrealitytoolkit.input/Visualizers/PlatformHandVisualizer/PlatformHandMeshVisualizer.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the BSD 3-Clause
33

44
using System.Collections.Generic;
5+
using Unity.XR.CoreUtils;
56
using UnityEngine;
67
using UnityEngine.XR;
78

@@ -102,7 +103,8 @@ protected void Update()
102103

103104
// This hand mesh is provided pre-translated from the world origin,
104105
// so we want to ensure the mesh is "centered" at the world origin
105-
transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity);
106+
PlayspaceUtilities.XROrigin.CameraFloorOffsetObject.transform.GetPositionAndRotation(out Vector3 position, out Quaternion rotation);
107+
transform.SetPositionAndRotation(position, rotation);
106108
}
107109
}
108110
#if MROPENXR_PRESENT && (UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_ANDROID)
@@ -123,7 +125,7 @@ protected void Update()
123125
initializedUVs = true;
124126
}
125127

126-
transform.SetPositionAndRotation(pose.position, pose.rotation);
128+
transform.SetWorldPose(PlayspaceUtilities.TransformPose(pose));
127129
}
128130
#endif
129131
else

0 commit comments

Comments
 (0)