methusalah / SplineMesh

A Unity plugin to create curved content in real-time with bézier curves
https://twitter.com/dumas181
MIT License
1.05k stars 104 forks source link

Fix incorrect calculation of roll in splines #18

Closed bladeSk closed 5 years ago

bladeSk commented 5 years ago

Roll worked correctly only if the spline was oriented along the X-axis. This fix makes it work with any direction.

Furthermore, undesirable roll was applied to ExtrusionSegments - roll already comes baked into a SplineSample's rotation.

methusalah commented 5 years ago

Thanks a lot for you contribution ! It's always a true pleasure to welcome contributors in.

Halas your changes don't work on the vertical situation, where a gimball lock occurs. You can observe it on the last example in the showcase.

This is a known problem reported in issue #14. I think the solution is somewhere near your modifications, but I'm not able to work on it right now, unfortunately.

I've reset the master but don't hesitate to pull more code.