So today was pretty useless. I did a lot of moving my code around and never accomplished any more objectives. I did however move the terrain into the scene model. I added a number of new commands to the scripting language that can be used to define demos.
All the primitives now have a bounce coefficient that I can use to as soon as I have collisions working. With the terrain moved into the scene structure I now have everything contained in a single structure. That makes writing my collision detection algorithm much easier. And now in my main graphics loop I can make these 3 calls:
fix_crashes will be extremely difficult to code. I have to write a different collision algorithm for each shape… terrain, sphere, and cylinder. The collisions have to be checked for between every object, edge, face, and point in the scene. If there is a collision then I have to back up the movement and recompute a new trajectory and put the object in a new position. I’m going to have to ponder this one.
My head is pounding. so I’m calling it a night.