From 3fdd0d62d4b2d66a8e534842bb4408cb159e50fc Mon Sep 17 00:00:00 2001 From: kiruma524 <71787194+kiruma524@users.noreply.github.com> Date: Fri, 9 Jul 2021 18:23:56 +0300 Subject: [PATCH] Update OrbitControls.kt --- .../kscience/visionforge/solid/OrbitControls.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/visionforge-fx/src/main/kotlin/space/kscience/visionforge/solid/OrbitControls.kt b/visionforge-fx/src/main/kotlin/space/kscience/visionforge/solid/OrbitControls.kt index 47c3c8e8..a32e44f5 100644 --- a/visionforge-fx/src/main/kotlin/space/kscience/visionforge/solid/OrbitControls.kt +++ b/visionforge-fx/src/main/kotlin/space/kscience/visionforge/solid/OrbitControls.kt @@ -59,13 +59,13 @@ class OrbitControls internal constructor(camera: Camera, canvas: SubScene, spec: private val ry = Rotate(0.0, Rotate.Y_AXIS) - private val translate = Translate() + private val rz = Rotate(0.0, Rotate.Z_AXIS) - //private val rz = Rotate(180.0, Rotate.Z_AXIS) + private val translate = Translate() init { - camera.transforms.setAll(ry, rx, translate) + camera.transforms.setAll(rx, ry, rz, translate) update() val listener = InvalidationListener { update() @@ -143,8 +143,8 @@ class OrbitControls internal constructor(camera: Camera, canvas: SubScene, spec: mouseOldY = mousePosY mousePosX = me.sceneX mousePosY = me.sceneY - mouseDeltaX = mousePosX - mouseOldX - mouseDeltaY = mousePosY - mouseOldY + mouseDeltaX = mouseOldX - mousePosX + mouseDeltaY = mouseOldY - mousePosY val modifier = when { me.isControlDown -> CONTROL_MULTIPLIER @@ -176,4 +176,4 @@ class OrbitControls internal constructor(camera: Camera, canvas: SubScene, spec: } fun Camera.orbitControls(canvas: SubScene, spec: CameraSpec) = - OrbitControls(this, canvas, spec) \ No newline at end of file + OrbitControls(this, canvas, spec)