Monday, June 13, 2011

Unity: Zone Boundaries

Just a short update: Zone boundaries work well. I removed the BoxCollider and added a custom OnDrawGizmos() method to display the boundary as a wire rectangle on the zero-z-plane. I also, quite surprisingly, figured out how to project the camera's viewing area onto the zero-z-plane. Now, to prevent rendering outside the zone, I clamp the camera's position.x to (minimumX + halfViewPlaneWidth) and (maximumX - halfViewPlaneWidth), and similar for position.y. Now I need to solve how to zoom the camera in when the zone width is less than the view plane width, and I'll follow with a playable update.

And in the spirit of honesty, I also need to track down my high school math teacher and apologise for telling him I will never have a use for the shit I now desperately wish I had been more attentive to. Rochelle, if you're reading this, I'm just going to blame YOU for that!

No comments:

Post a Comment