commonMain.casperix.scene.camera.orbital.OrbitalCameraState.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scene-camera Show documentation
Show all versions of scene-camera Show documentation
Camera control (regardless of the specific engine)
The newest version!
package casperix.scene.camera.orbital
import casperix.math.spherical.float64.SphericalCoordinateDouble
import casperix.math.vector.float64.Vector2d
import kotlin.math.PI
data class OrbitalCameraState(
val pivot: Vector2d,
val offset: SphericalCoordinateDouble,
) {
val position get() = pivot.expand(0.0) + offset.fromSpherical()
val direction get() = -offset.fromSpherical().normalize()
val up get() = offset.copy(verticalAngle = offset.verticalAngle - PI / 2).fromSpherical().normalize()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy