Camera Splines Toolset

Camera Spline Toolset

This is a spline based camera tool that I made to help simply camera's and allow for dynamic interesting movements. The tool works by laying paths for the camera to move along, and It will move as close to the player as the paths allow it.

Does it do?

The toolset gives the designer a simple spline tool, it lets them add and remove nodes from anywhere, move the 2 arms to alternate the rotations, but I wanted to add a few more features of my own. Unlike other spline based camera sets, mine allows for multiple paths from a node, creating branches. This system is good when the player is moving vertically upwards from a node. But this branching system might not always be enough so it also allows for changing between splines when he enters a trigger box, and when he leaves the trigger box, based on his direction, It'll move to a specific spline.

How does it work?

I've done a bit of research into finding the most optimized method for finding the closest point to a spline, and the mathematics got quite complicated. I found that most people would use Divide and Conquer methods to find the closest point, which works, but takes quite a lot of iterations. I ended up designing a system that uses only minimal iterations (Something like 5 is enough) and a square root. It works by not considering the entire spline as a whole, but as small, individual segments and sliding backwards and forwards towards the player. This means I only technically need to do 2 checks, on the right and on the left, the more iterations helps when the spline has erratic movements. Because I've already precomputed these segments during the editor stage, I can find the closest point he's on, and then consider the 2 segments next to it as straight lines, and find the closet point to the line, which is quite simple cheap math. I've found this system to give identical results as the 1000+ iteration methods with 1/100th of the processing power.

If you'd like to know more or see some of the code, feel free to message me or leave a comment bellow!

Tags: