Skip to content

Targeting both Android and PCVR

oneMillionWorlds edited this page Nov 29, 2025 · 1 revision

Objective

You may wish to target both PCVR (to target PC tethered systems) and android (to target systems like the Quest which run standalone). Tamarin is structured to make that easy

Approach

This guide assumes a Gradle structure, this is also possible with maven or other build systems.

Modules

You should have (at least) 3 modules that in this guide will be called app, pcvr-launcher and android launcher

app module

This should be your largest module and should contain your game logic and abstract VR logic. It should have these gradle dependencies (and possibly more as required):

* com.onemillionworlds:tamarin-core
* org.jmonkeyengine:jme3-core

Within this module you can refer to most Tamarin functionality but the app states you use should be XrBaseAppState, XrActionBaseAppState and VRHandsAppState. These are general (and in the case of XrBaseAppState and XrActionBaseAppState) abstract classes that encapsulate functionality that isn't different between android and PCVR

pcvr-launcher

This should be a very small module that represents the entry point of your application and will look similar to Getting started (Desktop). It's job is to attach XrAppState (pcvr version of XrBaseAppState), XrActionAppState (pcvr version of XrActionBaseAppState) and VRHandsAppState

android launcher

This should be a very small module that represents the entry point of your application and will look similar to Getting started (Android). It's job is to attach XrAndroidAppState (desktop version of XrBaseAppState), XrActionAndroidAppState(android version of XrActionBaseAppState) and VRHandsAppState

Summary

app module PCVR launcher Android launcher Purpose
XrBaseAppState XrAppState XrAndroidAppState Boot up the openXR environment and bind the openGL context to it
XrActionBaseAppState XrActionAppState XrActionAndroidAppState Obtain action states from openXR (e.g. button presses, hand poses)
VRHandsAppState VRHandsAppState VRHandsAppState Bind the hand models to the actual hand position (and provide high level hand related functionality

Clone this wiki locally