Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Add support for input and gestures for hand controllers #164

Merged
merged 116 commits into from
Sep 22, 2020

Conversation

FejZa
Copy link
Contributor

@FejZa FejZa commented Apr 27, 2020

Overview

Companion PR to XRTK/com.xrtk.core#552

FejZa and others added 6 commits April 28, 2020 21:09
…e/hand-input

# Conflicts:
#	XRTK.SDK/Packages/com.xrtk.sdk/Profiles~/Input/DataProviders/GenericOpenVRController/Left/SpatialPointerProfile.asset
#	XRTK.SDK/Packages/com.xrtk.sdk/Profiles~/Input/DataProviders/GenericOpenVRController/Left/SpatialPointerProfile.asset.meta
#	XRTK.SDK/Packages/com.xrtk.sdk/Profiles~/Input/DataProviders/GenericOpenVRController/Right/SpatialPointerProfile.asset
#	XRTK.SDK/Packages/com.xrtk.sdk/Profiles~/Input/DataProviders/GenericOpenVRController/Right/SpatialPointerProfile.asset.meta
Copy link
Contributor

@StephenHodgson StephenHodgson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment

/// </summary>
[System.Runtime.InteropServices.Guid("0B653537-D237-4622-ACC6-E351209A5882")]
public class HandControllerJointsVisualizer : BaseHandControllerVisualizer
public class HandControllerJointsVisualizer : MonoBehaviour
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably still need the guid, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think. This is now just a plain MonoBehaviour component in the SDK. It's not being assigned in the controller visualization profiles.

@FejZa FejZa marked this pull request as ready for review June 17, 2020 17:23
// gets updated before raising the event. If we don't update
// the focus provider here, the event will not be raised on the
// capture near interaction object.
MixedRealityToolkit.InputSystem.FocusProvider.Update();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StephenHodgson when you have some time could you please comment on this. I don't like this change at all but it's the only way to currently make near interaction work.

I didn't see a way to make it work without touching the FocusProviders itself and other components of the input system. In general I think we need to stop making these ad-hoc changes for near interaction and come up with a proper concept and data flow for near interaction to work. It doesn't feel quite there yet. I think what you did so far is a good starting point but upon debugging I found there is still more work to do to make this work. It's not enough to just register OnTriggerEnter() etc. We need to properly handle the focus change as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially what happens here is that I have to force an update / raycast on the focus provider before RaiseOnInput.... If I don't do this, the input event will not be raised on CapturedNearInteractionObject but instead on whatever the pointer was focusing before.

@FejZa FejZa merged commit a419b31 into development Sep 22, 2020
@FejZa FejZa deleted the feature/hand-input branch September 22, 2020 12:16
XRTK-Build-Bot pushed a commit that referenced this pull request Dec 25, 2020
* Move SDK asm definition to correct plact

* Fix recorded poses assets

* Fix simulation profiles

* Assign default tracked poses

* Copy over SDK changes

* fixed visualization references

* Undo GUID change

* Restore recorded hand pose JSON assets lost by merge

* Fix NRE for spatial pointer mapping

* Re-init simulated hand defaults

* Remove open steady pose

* Update hand pointer profile

* Update defaults for runtime hands

* Moved WMR hand data provider profile to WMR module

* Reduce profile redundancy a bit

* Fix visualized joint rotations

* Moved simulated hand data provider profile

* Moved WMR profile to WMR module

* Update profiles

* Updated profiles

* changes for near pointer interactions using collision

* removed unused reference

* Update BaseControllerPointerInspector.cs (#175)

* Update index finger pose mapping for hands

* Use triggers instead of physics colliders

* Update BaseControllerPointer.cs

* Create hand near poniter prefab (temp?)

* only raise pointer events if we have a valid pointer target

* revert

* Delete surface touch prefab

* Create near pointer prefab variant

* Introduce hand rendering mode

* Implement visuailzation runtime switch and update prefabs

* Fix none rendering mode

* Fix existing joints not enabled on enable

* Update prefabs

* Remove redundant check

* Create custom pointer prefab for hands

* Implement runtime physics toggle

* Implement runtime bounds mode selection

* Fix visuailzation script guid reference

* Reduce hand mass

* Set hand weight to average human hand weight

* Update assets

* Update IsNearPointerIdle computed property

* Implement spatial pointer transform

* Update pointer mesh

* Use local position only for joint poses

* Add debug utility to record hand data

* Goodbye NONE joint

* Rename joints

* Update default hand interactions

* Sync simulation profiles

* reserialized json data to exclude reference types (#192)

Fixed build errors from hand data recorder
updated log for near pointer

* Fix NRE in case tip prefab does not have a renderer

* updated spatial pointer from update loop to use input changed event (#193)

removed commented out stuff from near pointer
removed empty near pointer inspector
updated pointer inspectors to fallback if no inspector is made for derived types

* override interaction modes for hand near/spatial pointers

* updated prefab serialization

* Bake default poses

* Add tracked hand pose input action

* Update baked data for hand poses

* Fix spatial pointer disabled while interacting

* Fix spatial pointer line renderer start offset

* Fix rotation not set in local space

* Adjust spatial pointer mesh renderer settings

* Only update hand visusalization if hand is tracked

* Optimize foreach loop to for loop

* Get mesh data using TryGetHandMeshData

* Remove HandData input event

* Fix physics companion pose not updated

* Remove tracked pose raw input action

* Fix hand controller profiles default mappings

* Set graphics quality to highest for vr devices

* Fix interaction mappings for hand controllers

* Fix near pointer target not updated

* Temporarily change hand prefabs for better debugging

* Make colliders dict readonly

* Remove debug hand visualization

Co-authored-by: Stephen Hodgson <hodgson.designs@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants