urho3d/Urho3D — pull request #132 by alexparlett (2014-01-16 23:06:28+00:00)
Title: Add a simple spline component with Bezier Curve Interpolation

A Simple Spline class designed as a component.

Attach - Moves to the last point the parent node was attached to the spline or the start if Reset was called or no movement has occurred.
Detach - Detachs the parent node from the spline. Pauses all movement.
Reset - Resets the movement and detaches the node.
Move - Move the parent node to the next position of the spline.

The distance calculation is a little rough, anyone with better math than me please feel free to improve it, but it works at the moment.

I decided not to lock down the implementation to Bezier Curves as I'll look into a Catmull-Rom implementation as well in the near future. Also Linear interpolation wasn't included directly as a Bezier Curve with only two points does the same thing.

Here's a very basic example of usage:

```
class Test : ScriptObject
{
Spline@ spline;

void Start()
{
@spline = node.GetComponent("Spline");

spline.Push(Vector3(0,0,0));
spline.Push(Vector3(0,0,100));
spline.Push(Vector3(100,0,100));

spline.Attach();
}

void Update(float timeStep)
{
spline.Move();
}
}
```

References #125.