|
'Spatial Controller (Spatial Interaction Source) 045E-065B': { |
A few things :)
Firstly - we refer to the current in-market devices as "Windows motion controllers". In terms of naming convention, I would suggest 'motion controllers'.
It is unfortunately not possible to do an exact string match on device ID - the last section (045E-065B) will vary based on the specific connected device. As an example: if you use the Simulator, the controllers will actually come through as:
Spatial Controller (Spatial Interaction Source) 00FF-FF00
We recommend doing a string startsWith test for: 'Spatial Controller (Spatial Interaction Source) ' to determine that the device is a motion controller to choose button mappings.
The next piece of the puzzle is support for the devices pointing ray direction and position offset. You may notice that the device pose does not accurately reflect where you are pointing (this is similar to Oculus Touch controllers). You can really see this if you compare the pointing ray from the VRController to that in the Mixed Reality cliffhouse.
To make matters a bit more complicated - the ray offset and direction actually vary depending on what kind of motion controller is plugged in connected - which is discernable by looking at the code portion of the device ID. As an example, you can use the following regex to get the device code:
/([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/
There are currently 2 distinct devices supported by Windows Mixed Reality, each having a slightly different form factor and pointing direction. (They have the same button mappings). GLB (binary glTF) files of these two devices are available at this fork of the a-frame assets repository:
https://github.com/leweaver/assets/tree/msft/new-controller-model/controllers/microsoft
The pointing pose offset can actually be found in those glTF files, on the node named POINTING_POSE
. That node is transformed such that it faces outward in the direction of the pointing pose. It is a local transform, so an attached line would be oriented correctly (ie, it relies on the transform accumulation of the parent nodes).
Happy to provide more info!
Lewis