Package-level declarations
Types
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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? = createDefaultCameraManipulator(sharedCameraNode?.worldPosition), 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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun rememberCameraManipulator(orbitHomePosition: Position? = null, targetPosition: Position? = null, creator: () -> Manipulator = {
SceneView.createDefaultCameraManipulator(orbitHomePosition, targetPosition)
}): Manipulator
Link copied to clipboard
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
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
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
Link copied to clipboard
Link copied to clipboard
fun rememberViewNodeManager(context: Context = LocalContext.current, creator: () -> ViewNode2.WindowManager = {
SceneView.createViewNodeManager(context)
}): ViewNode2.WindowManager
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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(
cameraNode.worldPosition
), 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)