Problem with tween Linear transition #115
-
I have 4 PhantomCams3D, 3 of them transition properly between eachother, but when phantomcam3 transitions to phantomcam 4, the transition rotates along the "long away around" doing an entire 360 instead of just rotating the simpler shorter way like the others. It happens only between PhantomCam3 and PhantomCam4. PhantomCam3 is on the right, PhantomCam4 is on the left Any ideas on what causes the issue and/or how to resolve it? The tool has been fantastic and would love for this to work |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
That's because I've been a bit silly with the way interpolation works for 3D rotation and didn't do it the proper way. Am refactoring how the tweening and lerping system works in 0.5, so should resolve this, among other, issues. For now, would suggest either grabbing the master branch, which has this fix but might be a bit unstable, or alternatively inject following bits into Note: The below code will very likely cause errors if you're also using
var previous_active_pcam_basis = Quaternion(_previous_active_pcam_transform.basis.orthonormalized())
camera.set_quaternion(
Tween.interpolate_value(
previous_active_pcam_basis, \
previous_active_pcam_basis.inverse() * Quaternion(_active_pcam.basis.orthonormalized()),
tween_duration, \
_active_pcam.get_tween_duration(), \
_active_pcam.get_tween_transition(),
_active_pcam.get_tween_ease(),
)
) That should mimic the behaviour in the master branch for this property and rotate the camera along the shortest route. |
Beta Was this translation helpful? Give feedback.
-
Code injection solve is written above. Proper implementation will be in v0.5. |
Beta Was this translation helpful? Give feedback.
That's because I've been a bit silly with the way interpolation works for 3D rotation and didn't do it the proper way.
Am refactoring how the tweening and lerping system works in 0.5, so should resolve this, among other, issues.
For now, would suggest either grabbing the master branch, which has this fix but might be a bit unstable, or alternatively inject following bits into
phantom_camera_host.gd
:Note: The below code will very likely cause errors if you're also using
PhantomCamera2D
in 2D scenes, as this code is 3D specific. But you can surround the various bits withif _is_3D:
conditionals to solve that._previous_active_pcam_transform
below_previous_active…