Today I set out to make trees be properly selectable. Yesterday, it was very, very tricky to actually click on a tree; they just seemed to mostly ignore the cursor, depending on which bit of the tree you clicked on.
Found the problem; as it turns out, there were some bugs in the code which resulted in some of the pieces of the trees being ignored for collision; you couldn’t click on them or stand on them. But even once I had sorted that out, there were still many spots where the cursor simply wouldn’t be detected as moving over the tree.
Eventually, I tracked down the problem; it was affecting scaled model elements, such as the various bits of foliage; the VectorStorm matrix invert function had some pretty serious bugs in it, and that invert function was being used during the collision testing process. Thanks to a friend, I managed to diagnose and fix up the matrix invert functions, and now everything is working well again. The fixes are to vsMatrix4x4::Inverse() (and also affect vsMatrix4x4::Invert()). vsMatrix3x3 was not affected. These fixes will be migrated into the VectorStorm trunk in the near future. (somebody poke me if I forget.. this one is important to actually get back into trunk)
I also found and fixed the problem which was causing strange rendering glitches at the top of each blob of tree foliage, which I mentioned yesterday. This has highlighted how much more work there is to be done, in regards to generating texture coordinates for models. The current system (by chance) works reasonably well for foliage, but needs a lot more work to support everything else I want to do with it.
Finally, I found and fixed a bug which was causing tree branches to gnarl excessively at their tips — often twisting a full 180 degrees or more, right at the end of each branch! By and large, the tree generation is coming together quite well now, I think!