Fixed camera ScreenToWorld & WorldToScreen returning invalid values when Camera.UpdateTransform has only been called once, because interpolated zoom value is initially 0 which messes up the transformation matrices. Closes #504
This commit is contained in:
@@ -99,7 +99,7 @@ namespace Barotrauma
|
||||
|
||||
public Camera()
|
||||
{
|
||||
zoom = 1.0f;
|
||||
zoom = prevZoom = 1.0f;
|
||||
rotation = 0.0f;
|
||||
position = Vector2.Zero;
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace Barotrauma
|
||||
viewMatrix =
|
||||
Matrix.CreateTranslation(new Vector3(GameMain.GraphicsWidth / 2.0f, GameMain.GraphicsHeight / 2.0f, 0));
|
||||
|
||||
UpdateTransform();
|
||||
UpdateTransform(false);
|
||||
}
|
||||
|
||||
public Vector2 TargetPos
|
||||
|
||||
Reference in New Issue
Block a user