16
Support / Re: tk2dCamera.ScreenExtents incorrect when ZoomFactor not 1?
« on: August 21, 2013, 03:44:02 pm »
Thanks, you are right it does work in your package. After seeing that I did some more digging. My problem may have something to do with how I am trying to constrain my camera within bounds.
Here is what I'm doing and what I've found:
1. In my Update() loop I process my mouse scrolling and zoom the camera ZoomFactor accordingly
2. After zooming I immediately check my bounds and correct the camera if it is outside of the bounds (when I do this all the calculations seem correct and the camera should be correctly adjusted. I even create a cube with the camera extents at this point to visually see that it is within the bounds - looks correct)
3. Shortly afterwards something calls tk2dCamera.OnPreCull() and that calls UpdateCameraMatrix() which changes the camera extents. This changes the camera to display areas outside of my bounds. I am not sure what is causing this, any insights into that?
Here is what I'm doing and what I've found:
1. In my Update() loop I process my mouse scrolling and zoom the camera ZoomFactor accordingly
2. After zooming I immediately check my bounds and correct the camera if it is outside of the bounds (when I do this all the calculations seem correct and the camera should be correctly adjusted. I even create a cube with the camera extents at this point to visually see that it is within the bounds - looks correct)
3. Shortly afterwards something calls tk2dCamera.OnPreCull() and that calls UpdateCameraMatrix() which changes the camera extents. This changes the camera to display areas outside of my bounds. I am not sure what is causing this, any insights into that?