Tuesday, January 25, 2011

4.0 Conversion

We're now converting our project over to XNA 4.0. This also entails restructuring and cleaning up the code. I had to fix a few glitches with how the AI enemies were updating their direction. With the player, the controller determines their rotation, but with the AI, their direction is determined by actually changing it to point toward the player. Because the model's "forward" vector was being updated but the "up" and "right" vectors were remaining the same, the draw function was skewing the models and they eventually disappeared entirely. The world matrix was getting updated with every call, but for some reason, calling "Direction.Normalize()" wasn't actually normalizing the direction vector. I finally tried "Direction = Vector3.Normalize(Direction)" and that seemed to work. I still don't know why the other call wasn't acting like it's supposed to. It was probably silently failing for some reason.

I also got a few of the HUD elements back into place, although they're still not fully functional and I still need to clean up some of that code to adjust for the "title safe" area.

No comments:

Post a Comment