[orx-camera] Add option to disable motion damping

This commit is contained in:
Edwin Jakobs
2020-08-12 18:28:09 +02:00
parent 7116f49118
commit d695d07708
2 changed files with 16 additions and 2 deletions

View File

@@ -104,6 +104,11 @@ class OrbitalCamera(eye: Vector3 = Vector3.ZERO, lookAt: Vector3 = Vector3.UNIT_
dirty = true
}
fun scaleTo(s: Double) {
magnitudeEnd = s
dirty = true
}
fun zoom(degrees: Double) {
fovEnd += degrees
dirty = true
@@ -118,7 +123,7 @@ class OrbitalCamera(eye: Vector3 = Vector3.ZERO, lookAt: Vector3 = Vector3.UNIT_
if (!dirty) return
dirty = false
val dampingFactor = dampingFactor * timeDelta / 0.0060
val dampingFactor = if (dampingFactor > 0.0) { dampingFactor * timeDelta / 0.0060 } else 1.0
val sphericalDelta = sphericalEnd - spherical
val lookAtDelta = lookAtEnd - lookAt
val fovDelta = fovEnd - fov