This week I've been working on getting the camera collision stuff to work properly. Our original decision for how it should work is this:
Find the number of collisions starting from the player and going toward the camera (and past the camera as well). If the number you find is even, don't do anything. Otherwise, perform collision at the FARTHEST point away from the player. This was working decently (except for a problem that still exists, I'll mention it in a bit), except if there are walls/blocks in the FMZ, they throw off the algorithm for the even/odd numbers. So my fix for that was that if it collides with a wall or block first, immediately perform collision with it and be done. That works quite well.
Now for the problem that I mentioned before. I don't know why it's happening or what is causing it, but if I move the sub to the FMZ that has the blocks and walls (I actually haven't tested it in other FMZs yet) I can position the sub in such a way that the camera doesn't collide properly and goes out of bounds. When I set up breakpoints to monitor what's happening, there are usually 4-5 collisions detected, most of them being walls or blocks. That makes absolutely no sense since there are no walls or blocks out of bounds. I am completely at a loss as of now as to why it's doing this, but I'll hopefully figure it out on Monday.
-Matthew Bryant
No comments:
Post a Comment