I started the day with some more reading of the Meta documentation, and ended up installing the Meta XR Simulator and doing some additional project configuration to minimize build times.
The Meta XR Simulator (version 54.0.1-preview) consistently crashed my Unity Editor (2022.3.6f1) on both pc and laptop, so I decided to not use it for now, because otherwise I might end up losing a day reading forum discussions and trying all kinds of workarounds to get it working. After all, when they say it's an experimental preview, you can't complain too much.
I kept skimming the documentation and took note of which SDKs offered by Meta could help me build my vision. I must say I'm quite impressed about the amount and quality of the provided documentation and features, at least at first glimpse.
I will definitely go back to many of the subsections along the way, but now, it's time to get some basic input working.
I quickly followed the Meta tutorials and tested basic controllers and hand input.
Now, I'd like to allow teleporting to one adjacent platform.
This task can be decomposed in
figuring out which is the "current" target platform
detecting an input command and moving the player to such platform
I want to allow movement only to adjacent platforms, so for every platform there will be a set of potentially accessible platforms containing their neighbours (at most 6, for a platform with a neighbour next each side).
One idea I have to easily and precisely decide which is the selected target platform is considering where the player is standing in the platform. Standing on each of the six triangles composing the platform will allow moving to the platform opposite to that triangle, opening a portal cutting the hexagon in half. But the portal is a problem for another day: as first step, let's detect in which triangle the player is standing, and highlight the corresponding target platform. Pressing the A button on the right controller will teleport to such platform.
I added to my hexagon grid class some utility methods I needed to proceed:
get the centre position of a certain platform
calculate on which triangular slice of the current platform the player is positioned (and so, which is the opposite)
given a triangular slice, find out which platform is next to that edge (will be the teleportation target)
Initially, something was off with my calculations, and this was the right moment to add some "visual debugging" elements, which are key to quickly figure out problems (and to easily check that things are working as expected).
I added to the scene a sphere to visualize the projection of my head on the current platform, and a quick "3dArrow" sticking together a cylinder and a cone (taken from the Oculus SDK), to position on the "opposite" edge. Then, I added to the platforms a method to change their material color, and I highlighted the current "teleport target" platform with red.
After a bit of playing with the hexagon grid indices, I got it working as I wanted:
Of course, this is just the first step (pun not intended) in building the locomotion system that I have in mind, but it's good enough to end the second day of development.