Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

693 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NextVR-Android

Ambiente de trabalho espacial (Spatial Workspace) e Realidade Mista (MR) open source para smartphones Android, construído sobre o SDK do Google Cardboard com recursos avançados de passthrough e rastreamento de mãos.

✨ Principais Recursos

  • Passthrough Nativo: Visualização do ambiente real em tempo real utilizando a API Camera2 do Android.
  • Hand Tracking (Rastreamento de Mãos): Interação natural sem controles físicos utilizando MediaPipe Tasks Vision.
  • Janelas Espaciais Flutuantes: Suporte a múltiplas janelas 3D estereoscópicas, navegador integrado, dock de aplicativos e teclado virtual.
  • Standalone Mobile: Roda de forma totalmente independente no smartphone Android, sem necessidade de PC.

🛠️ Tecnologias Utilizadas

  • Android SDK (Java / Kotlin)
  • Google Cardboard SDK
  • MediaPipe Tasks Vision
  • Android Camera2 API

👤 Autor e Mantenedor

Build

Open the repository root in Android Studio and select nextvr-android, or:

./gradlew :nextvr-android:testDebugUnitTest :nextvr-android:assembleDebug
adb install -r nextvr-android/build/outputs/apk/debug/nextvr-android-debug.apk

The app automatically builds/extracts the Cardboard SDK through extractNdk. No separate SDK build step is required. ARM32 and ARM64 are enabled; a real device is needed for meaningful VR, hand/camera and audio acceptance tests.

Android CI builds the APK and publishes the nextvr-debug-apk artifact. CI also tests the actual HTML UI and verifies that bundled assets match source.

Successive CI builds share one debug signature: the workflow copies signing/debug.keystore (the stock Android debug key, androiddebugkey/android) to ~/.android/debug.keystore before building. Without it every runner generates a fresh key and installing a new round over the previous install fails with App not installed. The first install after this change needs the previous build uninstalled once, because that one was signed with a generated key.

XFC — the XF Esports football game

xfc-game/ holds XFC, the XF Esports football game — a regular football game, not VR. It includes the splash and hub, Kick Off team picker, squads, cup campaign and a 3D match with touch controls. Match play now includes explicit human actions for kick-offs and restarts, direct free kicks, referee discipline and manual sliding tackles. It is a self-contained web app (HTML, CSS and ES modules) packaged offline in its Android APK and does not touch the NextVR/VR code.

node xfc-game/serve.mjs               # http://127.0.0.1:8080
node --test tests/xfc-game.test.mjs   # dados do elenco e fluxo das telas

See xfc-game/README.md for the structure and the credits of the images.

Develop the reference UI

npm ci
npm run build:ui
npm test

Edit web/index.html and web/src/, not the minified APK bundle. These files originate from the supplied archive: the UI has not been replaced with a native-widget approximation. The native adapter rasterizes the real DOM into stable texture regions and submits its THREE world matrices to the Cardboard compositor. Browser contents run in isolated WebViews in the same spatial windows.

The headless Chromium test dependency needs standard Linux browser libraries (libnss3, libnspr4) on minimal development images. The Ubuntu CI runner already supplies them.

Direct Touch (poke interaction)

The hand UI is touched the way a Meta Quest is: the index finger has to reach the surface and push it. Approaching a button only highlights it; contact shows a contact ring at the fingertip; pushing through the target's plane fires exactly one click, once per press, and the finger must leave the contact area before another click can happen. The old "select while passing by, click when the finger lifts" heuristics are gone from windows.js — they fired on tracking noise. Depth is measured in metres against the target's plane (the window surface, or the dock/keyboard plane), with an absolute threshold and a relative push, live samples only (never predicted ones). Pinch is not the click mechanism, and the pinch ray is untouched. States, thresholds, what happens on each kind of target and how to tune it: docs/DIRECT-TOUCH.md.

Palm cursor (the dot between thumb and index)

The NextVR dot tracks the Meta Quest 3S behaviour: it appears when the palm faces the camera/headset and disappears when the back of the hand does, for either hand, each with its own cursor. Orientation is geometry, not the hand's height or finger pose: the palm plane comes from three 3D landmarks (wrist, index MCP, pinky MCP), the normal is oriented per hand (left and right mirror each other) and compared with the palm → eye direction via a dot product. A single gate per hand smooths it, applies hysteresis (a higher threshold to show, a lower one to hide), tolerates a short tracking miss and fades the dot out — it is never removed on the first bad frame. The dot keeps its old position between thumb and index, and the pinch trigger it already had (right: toggle Dock/Apps, left: brightness/volume window) is unchanged.

Thresholds, the 2D fallback and the honest limits: docs/PALM-CURSOR.md. Tracking pipeline, filters, latency and every fix: docs/HAND-TRACKING.md.

Latest UI/input update

See the interaction and floating-window revision and the hand-input investigation. The VR UI accepts only tracked hand input: gaze dwell, viewer-button activation and touchscreen forwarding are absent end to end; head rotation updates the view only. Recognized pinch/fist/contact transitions are preserved across slow UI drains, while redundant pointer moves are coalesced so a release is not queued behind them. Floating windows use deliberate drag thresholds, bounded world placement and proportional hand resizing. Hand tracking is one MediaPipe pipeline written for this project (com.nextvr.handtrack.HandTracker): both hands are detected and rendered together; when only one is present, a one-slot VIDEO graph keeps the common case responsive and a two-slot probe looks for the second hand every 250 ms. Once both are found, the two-slot graph follows both continuously. Per-hand prediction and confidence keep a brief missed detection from making its neighbour flicker. The PhoneXR fork pipeline (YOLO11 wrist recovery, CPU crop rescue on background threads) and its 11.7 MB AGPL pose model are gone. The multitask arc keeps the first app centered with the others alternating around it at half a window of clearance, and re-centers the survivors as apps close; dragging a floating window preserves its distance from the eye, so moving it never sends it backwards. The current N mark and component icons are extracted from new_references.zip; the older archive is retained only as historical provenance.

Android app windows

The dock has one dedicated Shizuku launcher for Android apps, separate from NextVR's own app/game library. Its window lists the installed Android apps with real icons, search, category filters, refresh, and a live result count. Each app opens in its own floating window on a Shizuku virtual display. This uses the Shizuku shell-user service (no root); if access is unavailable, the launcher explains the current state. The phone-screen mirror remains a separate, clearly labelled fallback, never presented as an embedded Android app. Full architecture, API choices, limitations and the on-device checklist: docs/ANDROID-APP-WINDOWS.md.

Version 1.0.11 adds Joy-Con and Bluetooth gamepad navigation. The control center remains a contained, ordinary spatial window in the 3D workspace, not a HUD overlay. Wi-Fi and Bluetooth open Android system panels; volume, app audio, and display brightness use the native bridge. The separate Shizuku launcher keeps Android apps out of the NextVR library, and its detail gear still opens the complete settings tabs.

Approved visual proposals (illustrative design references, not device screenshots):

Approved control-center design proposal

Approved Shizuku-window design proposal

PC Link (SteamVR)

The phone can act as the headset for a PC running SteamVR — not screen mirroring: the PC renders the game for this device, hardware-encodes it, the phone hardware-decodes it and shows one half per eye, while the head pose and both hands travel back at 60 Hz and move the game camera and its skeletal hands.

Three separate programs, three separate builds (docs/PC-LINK.md, protocol in pclink/PROTOCOL.md):

  • the Android side (nextvr-android/src/main/java/com/nextvr/app/pclink/) — discovery, control, 60 Hz tracking, MediaCodec into the eye texture;
  • the NextVR PC Bridge (pc-bridge/, Node ≥ 20, no dependencies) — discovery, one session at a time, video fragmented below the MTU, and the 744-byte state block the driver reads;
  • the NextVR SteamVR Driver (steamvr-driver/, MSVC 2022 + Windows SDK) — a virtual HMD and two hands publishing all 31 OpenVR bones, derived from the same 21 joints the app already tracks.

Honest scope: everything above is code that exists and is tested where it can be (byte layouts on both sides, geometry, the skeleton builder, a real loopback session against a fake phone), but nothing has been run against Windows, SteamVR or a headset from this repository's CI. XR_EXT_hand_tracking is not implemented (Skeletal Input is OpenVR and does not imply it), audio is not transmitted, and USB is USB tethering — adb forward is TCP-only and cannot carry the UDP video or tracking.

Games (PhoneXR)

Headset games are the PhoneXR library: the bundled OpenXR runtime (org.freedesktop.monado.openxr_runtime.out_of_process, pinned upstream and embedded in the APK) decides per game whether it can be hosted in-headset on the phone or has to be opened by the runtime launcher on the phone screen, and the shell reflects that state in the Applications menu (docs/PHONEXR-INTEGRATION.md).

A hostable game opens as a window in the world driven by the runtime: the workspace hides with its state preserved and restores exactly on exit, the game's stereo canvas is drawn by the same GLES2 panel pass as the other windows (left/right halves sampled per eye), and pinch input is gated between the shell and the game (a pinch over shell UI never presses a game button, and the game never receives a tap into shell windows). Holding a pinch with both hands for ~2 s opens the flat SteamVR-style game menu (Continue / Settings / Exit Game). There are no built-in demo games anymore — Minecraft VR, VRFS, Roblox and Brawl Stars were demo tiles over the 3D sandbox and are removed; the storefront points at the library instead of selling them.

Window placement is now free-space aware: web/src/spawn.js measures each surface by the angular rectangle it occupies in the user's view, so a new window is born where nothing is covered and a pinned arc slot slides aside when the user has parked a detached window in front of it. No minimum spacing is forced — two windows can still be placed edge to edge, or deliberately overlapping.

Controls

Action How
Start Grant camera permission, aim the native MediaPipe hand ray at a language in the close welcome window and pinch.
Look around Existing Cardboard head orientation; windows stay in the world and looking alone never activates them.
Select Aim the MediaPipe hand ray and pinch thumb/index; the hands and pointer use a softer, translucent overlay.
Joy-Con / Bluetooth gamepad D-pad or left stick moves the visible selection, A activates, B closes the focused window, and Home hides/restores the dock, floating windows and keyboard.
Move a window Close a fist over the window or pinch the white lower handle, move beyond the deliberate-drag threshold, then release.
Move the dock Pinch the visible grab handle just below the dock, move it to a comfortable spot, then release.
Resize a window Pinch the violet corner handle and move diagonally; size is proportional and bounded.
Direct touch Touch a surface within arm’s reach with your tracked index fingertip; default distant windows use the hand ray.
Return to dock arc Use the window's crosshair/repin control.
Browser scrolling Hold a hand pinch on the page and move.
Type Pinch a field — in a browser, shell window or Android app — to show the floating keyboard. Pinch a key to type; hold it to repeat or slide onto the next key.
Touchscreen/viewer button Not routed to the VR UI. Native close/settings remain Android safety/system controls.
Recenter Quick Settings → “Redefinir visualização”.
Play a game Library → Games filter → the game's tile. Hostable PhoneXR games open in-headset; the rest launch on the phone screen by the runtime.
Game menu Hold the pinch with both hands for ~2 s; a flat panel offers Continue, Settings and Exit Game.
Pair viewer Native settings → Switch Cardboard viewer. Before pairing, SDK Cardboard v1 defaults are used.
Adjust sound Phone's media-volume buttons; normal Android headphone/Bluetooth routing.
Exit Native close control or Android back.

Up to three regular app windows share the arc in addition to the dock, keyboard and HUD. Library/store styling, menus, settings, gallery, browser chrome and animations come from the prototype. The hand silhouette uses a dark teal fill and cyan contour, drawn from the APK's native MediaPipe landmarks; the camera stays with Camera2, so the WebView does not open a competing getUserMedia stream or download a second tracker from a CDN. Native filtering and pointer gestures remain in place. The sunset panorama is the default virtual environment; camera passthrough and the other 360° panoramas remain available.

Hand tracking performance

Performance measurement and the hand-tracking investigation are documented in docs/hand-tracking-investigation.md. Device measurement procedure and log summariser: tools/perf/README.md.

Code map

Path Responsibility
new_references.zip Unmodified primary visual/component reference; current N and icon paths originate here
references.zip Legacy workspace reference, used only where the newer archive has no corresponding component
web/index.html, web/src/apps.js, web/src/reference-icons.js Current styling, restored vectors, dock, library/store and application surfaces
web/src/windows.js, web/src/window-geometry.js World layout, bounded drag, proportional resize, keyboard and hand-ray interaction
web/src/typing.js Shared typing engine for shell fields and hosted browser WebViews (injected at document start)
web/src/hands.js Cyan hand contour and per-hand pinch cursor, driven by native MediaPipe landmarks
web/src/xr-games.js, web/src/two-hand-chord.js, web/src/spawn.js PhoneXR game mode, both-hands menu chord and free-space-aware window placement
…/xr/ Native PhoneXR game controller, runtime, library and hand bridge
…/hands/, …/PhoneXrHandRenderer.kt Native landmark filters/gestures and GL pointer rays/targets
…/com/nextvr/handtrack/ Hand-tracking engine: MediaPipe VIDEO graph, hunting graph while no hand is tracked, owned-bitmap input
web/src/atlas.js Stable HTML texture slots and world-transform submission
web/src/core.js Reference state, localization, content root and native pose input
nextvr-android/src/main/java/com/nextvr/app/PassthroughCamera.java Camera2 lifecycle, shared upright unmirrored bitmap, bounded OrangeHanding worker
…/SpatialRenderer.java 2D camera + OES HTML shaders, glass, alpha and per-eye world composition
…/WebSurface.java GPU-backed virtual-display WebViews, browser security, PhoneXR contact/media handling
…/NextVrActivity.java Lifecycle, JNI callbacks, permissions, HTML/native bridge and Android audio
nextvr-android/src/main/jni/nextvr_app.cc Existing Cardboard orientation, stereo framebuffer and distortion infrastructure
sdk/, java_api/, proto/, third_party/ Vendored official Cardboard SDK
tests/ Reference UI browser tests and spatial/security invariants
xfc-game/ XFC football game: splash, main menu, Kick Off team picker and squad screens (standalone web app)

Attribution

The Cardboard SDK/sample retains its Apache-2.0 headers and license. See third-party provenance for the bundled web libraries and models. The YOLO11 pose model of the earlier PhoneXR integration is no longer distributed. No UI theme or positional-tracking system from the linked NextVR repository has been substituted for the supplied prototype.

About

No description, website, or topics provided.

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages