rememberCameraState

fun rememberCameraState(initialEye: Position = Position(0f, 1f, 10f), initialTarget: Position = Position(0f, 0f, 0f), initialUp: Direction = Direction(0f, 1f, 0f), initialProjection: Projection = Projection.Perspective(), initialExposure: Exposure = Exposure(), initialFocusDistance: Float = 10.0f, initialShift: LensShift = LensShift.None, initialScaling: LensScaling = LensScaling.Identity): CameraState

Creates and remembers a CameraState.

The initial* values seed the state on first composition only — like every Compose remember*State (rememberPagerState(initialPage = …), …), later changes to these arguments are ignored. To drive the camera from other state, mutate the returned object:

val cameraState = rememberCameraState(initialEye = Position(0f, 2f, 5f))
LaunchedEffect(animatedEye) { cameraState.eye = animatedEye }