Firstly let me say, I am not trying to track objects in a video, neither is this an educational project or game in anyway, nor a commercial application. It is a hobby project I am working on in my spare time and I am looking for some advice on the best practice way of going forward.
Object movement
Objects are following one of several fixed paths (imagine for ease, a car going from A to E, via B and C) therefore because of path of motion is known, it should be trackable, given a known speed and time. However, establishing where it will be 5 or 10 seconds away has to be re-run continuously because the software could decide that because of other objects a better path is A to E via B and D, which may change where the object is in 10 seconds time. In addition, there is a need to establish if the object would hit a barrier, preventing it progressing, or if it would collide with another object on the same or a different path. The object movement parameters (ie rate of motion/choice of routing) are all being calculated by the software.
There could be anything from one to 200 objects moving around at different rates, accelerating or decelerating in their movement, on multiple paths at any one time.
My question therefore is within C++ (or perhaps Java) how is the best way to store the data, plot the various movements and establish collisions?
I had considered pure mathematical ways, but with the paths being various shapes and so many of them, that became very complicated. Equally, I considered establishing each object as a sprite, but I wondered whether that was an old school 1990s-style approach, and in the 21st century if there was a better way of plotting movement and establishing collision paths, in a Object Orientated language?
I am not looking for somebody to say “this is how you do it”, purely pointers on the methods and approach that could be used, and what the best practice approaches would likely be for this kind of programming scenario.