P-157: ForcePaths (T3D Resource)
I have taken a break from the spherical terrain and virtual world project to work on something a little less complex. I am creating a relatively simple script-only resource for T3D that simply moves objects and players along a path. The resource uses the existing T3D path system, and can be used to create a looping path or a non looping path.
This resource could be used to create currents in rivers, to move cameras or scene decorations around a level, to guide a player towards the next objective, or to create animated effects within a game level.
I am also working on a proximity detection feature which will automatically engage the “force” when the player intersects the path. This is proving to be a lot more complex that I thought, since the path is not solid, and the distance between nodes in the path is not known, and could be large, so I can’t just use a radius search.
Instead, I need to use vector math. I create a vector from the closest node to the player to the two other nodes in both directions. I then normalise these vectors, and scale them by the distance from the player to the closest node. Adding these vectors to the closest node gives me the two points closest to the player on the imaginary lines between the path nodes. If the distance from the player to either of these two points is less than a certain value, the player is captured within the force field.
This concept seems to work, but the implementation is still a little buggy.
I will post the link to the resource once I have uploaded it.
