File tree Expand file tree Collapse file tree
ViveInputUtility/Scripts/Misc/OculusVRExtension Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 [ ] { } ) ;
You can’t perform that action at this time.
0 commit comments