Spatial is a multi-module Android library that lives as a set of Gradle submodules inside your project. There is no Maven artifact to pull from a remote registry — you clone or copy the Spatial source tree alongside your app module, declare each submodule inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/danielitoCode/Spatial/llms.txt
Use this file to discover all available pages before exploring further.
settings.gradle.kts, and then add the three public modules as project(...) dependencies in your app’s build.gradle.kts. The internal modules (spatial-renderer, spatial-scene, spatial-core, and others) are pulled in transitively and do not need to be declared explicitly by application code.
Requirements
Before adding Spatial, make sure your project meets the following baseline:| Requirement | Value |
|---|---|
Android minSdk | 24 |
compileSdk | 36 |
| Kotlin | 2.x (tested with 2.2.10) |
| Jetpack Compose | Enabled (buildFeatures { compose = true }) |
| Device OpenGL ES | 3.0+ |
Module Structure
Spatial exposes three modules that application code imports directly. All other modules are internal implementation details resolved transitively by Gradle.Public modules
| Module | Package | Purpose |
|---|---|---|
spatial-compose | com.elitec.spatial_compose | The declarative Compose API — Scene, Element, Modifier3D, rememberCameraState, Gestures, CameraState |
spatial-compose-runtime-adapter | com.elitec.spatial_compose_runtime_adapter | Provides DefaultSceneRenderHostFactory, which wires the Compose layer to the OpenGL ES renderer and manages the AndroidView-hosted GL surface lifecycle |
spatial-units | com.elitec.spatial_units | The typed units system — meters, cm, and deg extension properties used throughout Modifier3D chains and rememberCameraState |
Internal modules (transitive)
These modules are part of the Spatial workspace but are never imported directly by application code:spatial-core— shared public contracts and module orchestrationspatial-renderer— OpenGL ES shader pipelines, render loops, and buffer managementspatial-camera— orbit camera, zoom, inertia, and dampingspatial-motion— animation timelines, spring systems, and easingspatial-gesture— multi-touch input, pinch zoom, orbit gesture, and velocity trackingspatial-material— flat-color material abstraction and shader metadataspatial-geometry— mesh and primitive generation (Cube, Sphere, Plane, Cylinder)spatial-light— light contracts and metadata (active light evaluation is outside Core #1)spatial-math— pure Kotlin math primitives:Vec2,Vec3,Vec4,Quaternion,Matrix4spatial-scene— scene graph, node hierarchy, and transform propagationspatial-runtime— Android runtime surface hosting
Step 1 — Include Submodules in settings.gradle.kts
Open (or create) your rootsettings.gradle.kts and include all Spatial modules alongside your existing app module:
rootProject.projectDir. If you place the Spatial source tree in a subdirectory (e.g., spatial/), prefix the module names accordingly and set each module’s project directory using project(":spatial-compose").projectDir:
Step 2 — Add Dependencies in app/build.gradle.kts
Declare only the three public modules as explicit dependencies in your app module. The internal modules are pulled in transitively:Step 3 — Enable Compose
If you have not already enabled Jetpack Compose in your app module, add the following toapp/build.gradle.kts:
kotlin.plugin.compose Gradle plugin must also be applied. In a version-catalog project:
gradle/libs.versions.toml: