[orx-camera] Fix panning in OrbitalControls
This commit is contained in:
@@ -56,7 +56,7 @@ class OrbitalControls(
|
|||||||
val offset = Vector3.fromSpherical(orbitalCamera.spherical) - orbitalCamera.lookAt
|
val offset = Vector3.fromSpherical(orbitalCamera.spherical) - orbitalCamera.lookAt
|
||||||
|
|
||||||
// half of the fov is center to top of screen
|
// half of the fov is center to top of screen
|
||||||
val targetDistance = offset.length * tan(fov / 2).asRadians
|
val targetDistance = offset.length * tan(fov.asRadians / 2)
|
||||||
val panX = (2 * delta.x * targetDistance / program.window.size.x)
|
val panX = (2 * delta.x * targetDistance / program.window.size.x)
|
||||||
val panY = (2 * delta.y * targetDistance / program.window.size.y)
|
val panY = (2 * delta.y * targetDistance / program.window.size.y)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user