Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit fd9a9a1

Browse files
authored
Merge pull request #383 from MozillaReality/controllers_local_pose
WebXRController to set local pose instead of world pose
2 parents 82fb7e9 + d03ff8c commit fd9a9a1

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

Assets/Plugins.meta

Lines changed: 0 additions & 8 deletions
This file was deleted.

Assets/WebXR/Scripts/WebXRController.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ private void onControllerUpdate(string id,
211211
position = sitStand.MultiplyPoint(position);
212212
}
213213

214-
_t.SetPositionAndRotation(position, rotation);
214+
_t.localPosition = position;
215+
_t.localRotation = rotation;
215216

216217
UpdateButtons(buttonValues);
217218
axes = axesValues;
@@ -282,15 +283,16 @@ void Update()
282283

283284
if (this.simulate3dof)
284285
{
285-
_t.SetPositionAndRotation(applyArmModel(
286+
_t.localPosition = applyArmModel(
286287
InputTracking.GetLocalPosition(XRNode.Head), // we use head position as origin
287288
InputTracking.GetLocalRotation(handNode),
288-
InputTracking.GetLocalRotation(XRNode.Head)
289-
), InputTracking.GetLocalRotation(handNode));
289+
InputTracking.GetLocalRotation(XRNode.Head));
290+
_t.localRotation = InputTracking.GetLocalRotation(handNode);
290291
}
291292
else
292293
{
293-
_t.SetPositionAndRotation(InputTracking.GetLocalPosition(handNode), InputTracking.GetLocalRotation(handNode));
294+
_t.localPosition = InputTracking.GetLocalPosition(handNode);
295+
_t.localRotation = InputTracking.GetLocalRotation(handNode);
294296
}
295297

296298
foreach (WebXRControllerInput input in inputMap.inputs)

0 commit comments

Comments
 (0)