First, here is my goal:
I want a 3D orthographic camera to "tweenly" rotate (by user control) around a pivot point that is parented to the player avatar (In this case, a ship. But that isn't important.) The intended effect is something like a 2D isometric game with full camera rotation. To be clear, this is all 3D made to look almost like 2D.
Here is my problem:
When the pivot point crosses over from positive to negative the Tween node flips the camera around in the opposite direction. In degrees; it switches from 180 to -180 and when I do it in radians; it switches from π to -π (obviously). When that crossover from positive to negative happens, the camera does (almost) a full spin. The camera should just cross over that positive/negative boundary without going back the other way. Hopefully, that makes enough sense that someone out there knows what I'm talking about.
Here is my node graph:
Camera (Camera, set as "Current")
"Ship" has code that is not pertinent to the camera other than its coordinates, which are taken from its child "CameraRig_0".
"CameraRig_1" has this code:
export var tween_time = 0.05
onready var cam_tween = get_node("CameraTween_1")
var strt_vect = self.global_transform.origin
var tgt_vect = $"../Ship/CameraRig_0".global_transform.origin
cam_tween.interpolate_property(self, "translation", strt_vect, tgt_vect, tween_time, Tween.TRANS_BOUNCE, Tween.EASE_IN)
That code works (for whatever reason) to make the camera follow the ship in a way that feels right. Now, on to the problem areas involving rotation. "CameraRig_2" has this code:
export var tween_time = 0.1
onready var cam_tween = get_node("CameraTween_2")
var strt_rot = self.rotation
var tgt_rot = $"../CameraRig_2_Target".rotation
print(tgt_rot) # Problem: Target switches from positive to negative so the tween flips around.
cam_tween.interpolate_property(self, "rotation", strt_rot, tgt_rot, tween_time, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
And then the simplest part: "CameraRig2Target" has this code:
var cam_rot_spd = 0.03
I could just use that last code and it would work just fine. But I want to be able to use the tweening without worrying about the tweening going in the wrong direction and creating that undesirable "spin" effect.
I'm sure that someone out there knows what I am trying to do, and they also know that I'm going about it in a 'bass-ackwards' way. I just need someone out there to set me on the right track.