Can I query the left and right eye pose relative to head pose?
I see in the Custom Component Starter Sample the execute() method fetches the head pose as follows:
var headPose: Pose = getScene()!!.getViewPose()
I assume this returns the position of the head sensor on the device in the current world coordinate system. Is there a way to fetch the positions/poses of the left and right eye relative to the head position?
Follow up: is it possible to have different transforms in the ECS components depending on which eye is being rendered?
Hi!
Unfortunately, we don't expose getting the eye positions in app via our APIs as of right now (I will make note of this). Likewise, we don't support having separate transforms for each eyes.
That being said, we do support shader branching based on which eye is rendering.
If you are using the default materials/shaders, you can use StereoMode to set if you want the content to be Left/Right or Up/Down. You can set this on the SceneMaterial itself or in the panel configuration.
If you are using custom shaders, you can use getStereoPassId() in your shader that returns 0 if it is rendering the left eye and 1 if it is rendering the right eye: https://github.com/meta-quest/Meta-Spatial-SDK-Samples/blob/1931b9d04f2e4979f005316127c39e926e44a1fe/MediaPlayerSample/app/src/shaders/data/shaders/custom/360.vert#L28
Hope this helps!