Package-level declarations

Types

Link copied to clipboard
typealias Entity = Int
Link copied to clipboard
typealias EntityInstance = Int
Link copied to clipboard
typealias FilamentEntity = Entity
Link copied to clipboard
typealias FilamentEntityInstance = EntityInstance
Link copied to clipboard
open class SceneView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0, sharedEngine: Engine? = null, sharedModelLoader: ModelLoader? = null, sharedMaterialLoader: MaterialLoader? = null, sharedEnvironmentLoader: EnvironmentLoader? = null, sharedScene: Scene? = null, sharedView: View? = null, sharedRenderer: Renderer? = null, sharedCameraNode: CameraNode? = null, sharedMainLightNode: LightNode? = null, sharedEnvironment: Environment? = null, isOpaque: Boolean = true, sharedCollisionSystem: CollisionSystem? = null, cameraManipulator: Manipulator? = createCameraManipulator(), var viewNodeWindowManager: ViewNode2.WindowManager? = null, onGestureListener: GestureDetector.OnGestureListener? = null, var onTouchEvent: (e: MotionEvent, hitResult: HitResult?) -> Boolean? = null, sharedActivity: ComponentActivity? = null, sharedLifecycle: Lifecycle? = null) : SurfaceView

A SurfaceView that manages rendering and interactions with the 3D scene.

Functions

Link copied to clipboard
fun Engine.createCamera(): Camera
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Engine.createModelLoader(context: Context): ModelLoader
Link copied to clipboard
fun Engine.destroyGeometry(geometry: Geometry)
Link copied to clipboard
fun Engine.destroyRenderable(entity: Entity)
Link copied to clipboard
fun Engine.destroyTransformable(entity: Entity)
Link copied to clipboard
fun rememberCameraManipulator(creator: () -> Manipulator = { SceneView.createCameraManipulator() }): Manipulator
Link copied to clipboard
fun rememberCameraNode(engine: Engine, apply: CameraNode.() -> Unit = {}): CameraNode
Link copied to clipboard
fun rememberCollisionSystem(view: View, creator: () -> CollisionSystem = { SceneView.createCollisionSystem(view) }): CollisionSystem
Link copied to clipboard
fun rememberEngine(eglContextCreator: () -> EGLContext = { SceneView.createEglContext() }, engineCreator: (eglContext: EGLContext) -> Engine = { SceneView.createEngine(it) }): Engine
Link copied to clipboard
fun rememberEnvironment(engine: Engine, isOpaque: Boolean = true, environment: () -> Environment = { SceneView.createEnvironment(engine, isOpaque) }): Environment
fun rememberEnvironment(environmentLoader: EnvironmentLoader, isOpaque: Boolean = true, environment: () -> Environment = { SceneView.createEnvironment(environmentLoader, isOpaque) }): Environment
Link copied to clipboard
fun rememberEnvironmentLoader(engine: Engine, context: Context = LocalContext.current, creator: () -> EnvironmentLoader = { SceneView.createEnvironmentLoader(engine, context) }): EnvironmentLoader
Link copied to clipboard
fun rememberMainLightNode(engine: Engine, apply: LightNode.() -> Unit = {}): LightNode
Link copied to clipboard
fun rememberMaterialLoader(engine: Engine, context: Context = LocalContext.current, creator: () -> MaterialLoader = { SceneView.createMaterialLoader(engine, context) }): MaterialLoader
Link copied to clipboard
fun rememberModelLoader(engine: Engine, context: Context = LocalContext.current, creator: () -> ModelLoader = { SceneView.createModelLoader(engine, context) }): ModelLoader
Link copied to clipboard
fun rememberNode(engine: Engine): Node
inline fun <T : Node> rememberNode(crossinline creator: () -> T): T
Link copied to clipboard
Link copied to clipboard
fun rememberOnGestureListener(onDown: (e: MotionEvent, node: Node?) -> Unit = { _, _ -> }, onShowPress: (e: MotionEvent, node: Node?) -> Unit = { _, _ -> }, onSingleTapUp: (e: MotionEvent, node: Node?) -> Unit = { _, _ -> }, onScroll: (e1: MotionEvent?, e2: MotionEvent, node: Node?, distance: Float2) -> Unit = { _, _, _, _ -> }, onLongPress: (e: MotionEvent, node: Node?) -> Unit = { _, _ -> }, onFling: (e1: MotionEvent?, e2: MotionEvent, node: Node?, velocity: Float2) -> Unit = { _, _, _, _ -> }, onSingleTapConfirmed: (e: MotionEvent, node: Node?) -> Unit = { _, _ -> }, onDoubleTap: (e: MotionEvent, node: Node?) -> Unit = { _, _ -> }, onDoubleTapEvent: (e: MotionEvent, node: Node?) -> Unit = { _, _ -> }, onContextClick: (e: MotionEvent, node: Node?) -> Unit = { _, _ -> }, onMoveBegin: (detector: MoveGestureDetector, e: MotionEvent, node: Node?) -> Unit = { _, _, _ -> }, onMove: (detector: MoveGestureDetector, e: MotionEvent, node: Node?) -> Unit = { _, _, _ -> }, onMoveEnd: (detector: MoveGestureDetector, e: MotionEvent, node: Node?) -> Unit = { _, _, _ -> }, onRotateBegin: (detector: RotateGestureDetector, e: MotionEvent, node: Node?) -> Unit = { _, _, _ -> }, onRotate: (detector: RotateGestureDetector, e: MotionEvent, node: Node?) -> Unit = { _, _, _ -> }, onRotateEnd: (detector: RotateGestureDetector, e: MotionEvent, node: Node?) -> Unit = { _, _, _ -> }, onScaleBegin: (detector: ScaleGestureDetector, e: MotionEvent, node: Node?) -> Unit = { _, _, _ -> }, onScale: (detector: ScaleGestureDetector, e: MotionEvent, node: Node?) -> Unit = { _, _, _ -> }, onScaleEnd: (detector: ScaleGestureDetector, e: MotionEvent, node: Node?) -> Unit = { _, _, _ -> }, creator: () -> GestureDetector.OnGestureListener = { object : GestureDetector.OnGestureListener { override fun onDown(e: MotionEvent, node: Node?) = onDown(e, node) override fun onShowPress(e: MotionEvent, node: Node?) = onShowPress(e, node) override fun onSingleTapUp(e: MotionEvent, node: Node?) = onSingleTapUp(e, node) override fun onScroll( e1: MotionEvent?, e2: MotionEvent, node: Node?, distance: Float2 ) = onScroll(e1, e2, node, distance) override fun onLongPress(e: MotionEvent, node: Node?) = onLongPress(e, node) override fun onFling(e1: MotionEvent?, e2: MotionEvent, node: Node?, velocity: Float2) = onFling(e1, e2, node, velocity) override fun onSingleTapConfirmed(e: MotionEvent, node: Node?) = onSingleTapConfirmed(e, node) override fun onDoubleTap(e: MotionEvent, node: Node?) = onDoubleTap(e, node) override fun onDoubleTapEvent(e: MotionEvent, node: Node?) = onDoubleTapEvent(e, node) override fun onContextClick(e: MotionEvent, node: Node?) = onContextClick(e, node) override fun onMoveBegin(detector: MoveGestureDetector, e: MotionEvent, node: Node?) = onMoveBegin(detector, e, node) override fun onMove(detector: MoveGestureDetector, e: MotionEvent, node: Node?) = onMove(detector, e, node) override fun onMoveEnd(detector: MoveGestureDetector, e: MotionEvent, node: Node?) = onMoveEnd(detector, e, node) override fun onRotateBegin( detector: RotateGestureDetector, e: MotionEvent, node: Node? ) = onRotateBegin(detector, e, node) override fun onRotate(detector: RotateGestureDetector, e: MotionEvent, node: Node?) = onRotate(detector, e, node) override fun onRotateEnd(detector: RotateGestureDetector, e: MotionEvent, node: Node?) = onRotateEnd(detector, e, node) override fun onScaleBegin(detector: ScaleGestureDetector, e: MotionEvent, node: Node?) = onScaleBegin(detector, e, node) override fun onScale(detector: ScaleGestureDetector, e: MotionEvent, node: Node?) = onScale(detector, e, node) override fun onScaleEnd(detector: ScaleGestureDetector, e: MotionEvent, node: Node?) = onScaleEnd(detector, e, node) } }): GestureDetector.OnGestureListener
Link copied to clipboard
fun rememberRenderer(engine: Engine, creator: () -> Renderer = { SceneView.createRenderer(engine) }): Renderer
Link copied to clipboard
fun rememberScene(engine: Engine, creator: () -> Scene = { SceneView.createScene(engine) }): Scene
Link copied to clipboard
fun rememberView(engine: Engine, creator: () -> View = { SceneView.createView(engine) }): View
Link copied to clipboard
@RequiresApi(value = 28)
fun rememberViewNodeManager(context: Context = LocalContext.current, creator: () -> ViewNode2.WindowManager = { SceneView.createViewNodeManager(context) }): ViewNode2.WindowManager
Link copied to clipboard
fun Engine.safeDestroy(): Result<Int>
Link copied to clipboard
fun Engine.safeDestroyCamera(camera: Camera): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroyEntity(entity: Entity): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroyEnvironment(environment: Environment)
Link copied to clipboard
fun Engine.safeDestroyGeometry(geometry: Geometry)
Link copied to clipboard
fun Engine.safeDestroyIndexBuffer(indexBuffer: IndexBuffer): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroyIndirectLight(indirectLight: IndirectLight): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroyMaterial(material: Material): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroyMaterialInstance(materialInstance: MaterialInstance): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroyMaterialLoader(materialLoader: MaterialLoader): Result<Unit>
Link copied to clipboard
fun AssetLoader.safeDestroyModel(model: Model)
Link copied to clipboard
fun Engine.safeDestroyModelLoader(modelLoader: ModelLoader): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroyRenderable(entity: Entity): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroyRenderer(renderer: Renderer): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroyScene(scene: Scene): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroySkybox(skybox: Skybox): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroyStream(stream: Stream): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroyTexture(texture: Texture): Result<Unit>
Link copied to clipboard
Link copied to clipboard
fun Engine.safeDestroyVertexBuffer(vertexBuffer: VertexBuffer): Result<Unit>
Link copied to clipboard
fun Engine.safeDestroyView(view: View): Result<Unit>
Link copied to clipboard
fun Scene(modifier: Modifier = Modifier, engine: Engine = rememberEngine(), modelLoader: ModelLoader = rememberModelLoader(engine), materialLoader: MaterialLoader = rememberMaterialLoader(engine), environmentLoader: EnvironmentLoader = rememberEnvironmentLoader(engine), view: View = rememberView(engine), isOpaque: Boolean = true, renderer: Renderer = rememberRenderer(engine), scene: Scene = rememberScene(engine), environment: Environment = rememberEnvironment(environmentLoader, isOpaque = isOpaque), mainLightNode: LightNode? = rememberMainLightNode(engine), cameraNode: CameraNode = rememberCameraNode(engine), childNodes: List<Node> = rememberNodes(), collisionSystem: CollisionSystem = rememberCollisionSystem(view), cameraManipulator: Manipulator? = rememberCameraManipulator(), viewNodeWindowManager: ViewNode2.WindowManager? = null, onGestureListener: GestureDetector.OnGestureListener? = rememberOnGestureListener(), onTouchEvent: (e: MotionEvent, hitResult: HitResult?) -> Boolean? = null, activity: ComponentActivity? = LocalContext.current as? ComponentActivity, lifecycle: Lifecycle = LocalLifecycleOwner.current.lifecycle, onFrame: (frameTimeNanos: Long) -> Unit? = null, onViewCreated: SceneView.() -> Unit? = null, onViewUpdated: SceneView.() -> Unit? = null)