Skip to content

feat: listener-anchored PHASE sources - #110

Open
Rubeanie wants to merge 1 commit into
apple:mainfrom
Rubeanie:listener-anchored
Open

Rubeanie wants to merge 1 commit into
apple:mainfrom
Rubeanie:listener-anchored

Conversation

@Rubeanie

@Rubeanie Rubeanie commented Sep 4, 2026 •

Copy link
Copy Markdown

Description

On visionOS, the shared listener pose is hidden, so parent the PHASE source under the listener.

SetListenerAnchored(bool) controls anchoring and IsListenerAnchored() reports it. Anchored sources send their Unity local transform, so parent the GameObject under the listener.

source.transform.SetParent(listener.transform, false);
source.transform.localPosition = headRelativeOffset;
source.SetListenerAnchored(true);

The native entry point PHASESetSourceListenerAnchored detaches first, returns the source to root on failure, and returns early if already parented. Listener destruction returns children to root, while recreation reanchors them.

The Matrix4x4 overload handles conversion; the Transform overload is addressed by #109.

Testing

Tested on Vision Pro with visionOS 26. Three device runs on 2026-09-04 showed PHASE read back matching Unity at zero delta, including scene reentry. Sources were head locked by ear and are in production use.

Related

@Rubeanie
Rubeanie marked this pull request as ready for review September 4, 2026 09:19
ryzngard pushed a commit that referenced this pull request Sep 16, 2026
…rm for RealityKit scenes, various typos and bugfixes. (#110)
@Rubeanie

Rubeanie commented Oct 2, 2026 •

Copy link
Copy Markdown
Author

Rebased this and PR #109 onto 27.0. With the new world root from 6afefa5, the anchoring code now uses [self root], nothing else changed.
Happy to keep these up to date or change them however suits!

@ryzngard

ryzngard commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Rubeanie . I've reached out to someone with a bit more knowledge of the PHASE code base to review this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants