How dairondanilo/filamentdanilo works
Project's Main Components
• Android Application Shell – The “app” directory shows that this is a standard Android project with an AndroidManifest.xml. It includes components like the MainActivity.kt and FilamentApp.kt, which are likely responsible for bootstrapping the app.
• UI Layer – Built using Jetpack Compose. Look at the “presentation/screens” directory (e.g., HomeScreen.kt) and the custom view FilamentSurfaceComposeView.kt in “presentation/components”. This layer handles all the visual presentation and user interaction.
• Rendering Module – This encapsulates all interactions with the Filament 3D engine. Inside “presentation/rendering” you have classes like FrameCallback.kt, RenderingLifecycleObserver.kt, and modelRendering.kt. These are responsible for managing rendering loops, frame callbacks, and interfacing with Filament.
• Interaction Module – Under “presentation/interaction”, include gesture detectors such as SceneDoubleTapListener.kt and SceneSingleTapListener.kt to handle touch events that manipulate 3D models.
• Dependency Injection (DI) – The “di” directory (with AppModule.kt) is used to manage dependencies throughout the app.
• Assets & Environment Configuration – The “assets” directory holds environments and model data. For instance, “assets/envs/default_env” contains environment configuration scripts (e.g., default_env_ibl.ktx) for lighting/skybox, and “assets/models” includes 3D models.
• Testing – Presence of both “androidTest” and “test” directories shows unit and instrumentation testing (ExampleUnitTest.kt, ExampleInstrumentedTest.kt).
Relationships and Interactions
• The UI Layer (Compose screens and custom Filament view) sends user actions (taps, gestures) to the Interaction Module.
• The Interaction Module translates these inputs into commands affecting the 3D scene rendered by the Rendering Module.
• The Rendering Module uses Filament to process model rendering, coordinate frame callbacks, and manage the rendering lifecycle.
• Dependency Injection (DI) feeds required services and objects into UI and rendering components.
• Testing layers are separate and validate the interactions between these components.
Architectural Patterns and Design Principles
• MVVM: The existence of ViewModel classes (e.g., HomeViewModel.kt) and clearly separated presentation logic indicates an MVVM pattern.
• Separation of Concerns: The architecture separates UI, rendering, business logic, and asset management.
• Dependency Injection: Using DI (via AppModule) promotes loose coupling.
• Modularization: Different directories are used to organize functionalities like rendering, interaction, and UI components.
Key Technologies, Frameworks, and Libraries
• Android SDK and Kotlin as the primary platform and language.
• Jetpack Compose for UI development.
• Filament for 3D model loading and real-time rendering.
• Gradle (Kotlin DSL) for build configuration.
• (Likely) a DI framework (e.g., Dagger/Hilt or Koin) as indicated by the “di” directory.
• Start at the highest level (Android OS, Application Entry Point) and drill down to individual modules (UI, Interaction, Rendering, etc.).