Skip to content

Commit 8cca8f2

Browse files
author
lawwong
committed
Make ovr tracked hand render model placed under RnederModelHook
1 parent a52fab5 commit 8cca8f2

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Assets/HTC.UnityPlugin/VRModule/Modules/OculusVRModule.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,12 @@ public override void UpdateRenderModel()
143143
if (m_handModel == null)
144144
{
145145
var handObj = new GameObject(typeof(OculusHandRenderModel).Name);
146-
handObj.transform.SetParent(hook.transform.parent.parent, false);
146+
handObj.transform.SetParent(hook.transform, false);
147+
handObj.transform.localRotation *=
148+
Quaternion.Inverse(
149+
isLeftHand ?
150+
Quaternion.LookRotation(Vector3.right, Vector3.down) :
151+
Quaternion.LookRotation(Vector3.left, Vector3.up));
147152
m_handModel = handObj.AddComponent<OculusHandRenderModel>();
148153
m_handModel.Initialize(isLeftHand);
149154
}

Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/OculusVRExtension/OculusHandRenderModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void Initialize(bool isLeftHand)
3232
updateRootScaleField.SetValue(m_ovrSkeleton, true);
3333

3434
FieldInfo updateRootPoseField = m_ovrSkeleton.GetType().GetField("_updateRootPose", BindingFlags.NonPublic | BindingFlags.Instance);
35-
updateRootPoseField.SetValue(m_ovrSkeleton, true);
35+
updateRootPoseField.SetValue(m_ovrSkeleton, false);
3636

3737
MethodInfo skeletonInitializeMethod = m_ovrSkeleton.GetType().GetMethod("Initialize", BindingFlags.NonPublic | BindingFlags.Instance);
3838
skeletonInitializeMethod.Invoke(m_ovrSkeleton, new object[] { });

0 commit comments

Comments
 (0)