Wednesday, January 10, 2007

Player / Camera Path Design

I further thought through my position path issue, and I decided that a 3 point bezier curve would work best for the situation. The equation is simple, and we can get it to do exactly what we want. So now the question is implementation.



Here's a quick diagram I drew up after thinking about it a bit. I decided that it would be best to split the points into segments. Each segment would either contain 2 points if it was a linear path or 3 points if it was a bezier curve. A segment can return a specific point within it between 0 and 100% of the segment. A path is an ordered collection of segments. The player object will be able to query the Path for it's current segment, and then ask the segment its current location.

I think this will work out nicely, I have the header files laid out, I just need to write the implementation. One issue that may crop up is that the player and camera are going to have to communicate so the player can basically billboard so he's always facing the camera. Friending classes will probably work okay.

Lollerskivvies and I laid out a basic world design on the whiteboard today, I may visio-ify it later in the week. Basically, it got us really excited for the world design phase.. which should be coming up very soon!

No comments: