Replay Mod (Fabric & Forge)

Replay Mod (Fabric & Forge)

787k Downloads

Non-linear interpolation causes camera to rotate long way around

slicedlime opened this issue ยท 1 comments

commented

For instance, I had a path with a camera yaw of 1 at one point and -303 at the next (=47), and it wrapped the long way around instead of the short way. This makes paths nearly impossible to make because the camera keeps spinning wildly out of place.

It looks to me like this code from LinearInterpolator.java:

           if (!Double.isNaN(bound)) {
                before = mod(before, bound);
                after = mod(after, bound);
                if (before < bound / 2 ^ after < bound / 2) {
                    // Wrapping around is quicker
                    if (before < bound / 2) {
                        after -= bound;
                    } else {
                        after += bound;
                    }
                }
            }

Has no corresponding code in the other interpolator classes.

commented

I cannot reproduce this using the cubic interpolation.
The corresponding code for it can be found in its super class, here.

I can however reproduce it with the CR interpolation and unless I'm missing something there doesn't seem to be any code to handle it.