CreativeMD / CMDCam

GNU Lesser General Public License v3.0
37 stars 21 forks source link

Camera spins #77

Closed moonarts closed 1 year ago

moonarts commented 1 year ago

I created an oval path camera, but my camera does a 360° spin in the middle of the path. I tried to recreate it multiple time, and it's always the same : https://youtu.be/FDwxkWXRQJk

Looks like 360° spin happens when from 2 points the orientation goes from positive to negative : Bug setup

CreativeMD commented 1 year ago

Can you save the path and send me your world? I have tried to reproduce it, but could not.

moonarts commented 1 year ago

I saved my path as "spin". Here is the world download (1.18.2) : https://we.tl/t-5IC52BbCug

CreativeMD commented 1 year ago

Ok there were several issues. First of all the loading did not work properly. Then as you pointed out the spinning_fix argument did not work. It has been fixed now.

About your issue CMDCam tries to preserve the original rotation of the player when setting the points. Here is an example: image The player sets the first point turns more than 180° to the right and sets another point. So how should the camera be rotated? Red is the shorter way, but blue is the original. That's why there are different modes. Originally CMDCam saved all rotations. So if a player turns around itself several times before setting the next point the camera spins will spin in the same way. This is not an issue if points are created directly after each other, but if you do something else, get back to it some time later and add a new point it will most likely be messed up. Long story short: This is fixed automatically by CMDCam. By default it's configured to fix_keep_direction, which is the blue way in the example above. You can change it to fix which will always take the shortest turn possible (in this example the red). There is a third option which restores the default before (as explained above).

Solution Somehow one of your points is turned in the wrong way, which causes this weird behavior. If you use the command /cam spinning_fix fix it will work just fine. Otherwise you could redo your path and take care how you rotate your view when setting the points.

I recommend to use a target instead, because this work no matter how you setup your points. Unfortunately it was bugged as well. This issue has also been fixed as well.

Conclusion So yeah a lot of stuff was broken. The new version has been uploaded and should be available soon. I hope it fixes your issue. If you need more information or have some question, feel free to ask.