Skip to content

Handle face tracking directly, without using ArFragment() #456

@PaulKlauser

Description

Currently, face tracking is handled by adding an invisible Fragment that extends ArFragment and feeds face tracking updates to a shared ViewModel observed by MainActivity.

This works, and that Fragment handles things like permissions and Google Play services usage for us automatically, however that automatic handling has some drawbacks:

  • The app closes if permission is denied (we've hacked around this)
  • The app can't run without Google Play services (the app should still run, just without face tracking)
  • Older devices that don't support AR can't run the app at all (the app should still run, just without face tracking)
  • The shared ViewModel pattern is an opportunity for misdirection

Because of these drawbacks, let's use ArSceneView directly, like ArFragment does under the hood, or like this example - https://github.com/PaulKlauser/face-tracker-demo/blob/main/app/src/main/java/com/example/facetracker/MainActivity.kt (this example is in Compose, but the SceneView idea is the same)

We should approach this incrementally, with some sort of basic feature flag in place so that we can merge in the new code without breaking the existing functionality, and then switch over once it's all merged in. No big-bang-here's-all-of-the-functionality-at-once PRs please :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Ready to select

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions