JuicyGraphics/src/JuicyGraphics/renderer/camera2D.cs

33 lines
678 B
C#
Raw Normal View History

using SharpGL;
using System.Numerics;
namespace Graphics {
class camera2D {
protected Matrix mat;
public Vector2 translation {
get {
return new Vector2((float)mat[0, 3], (float)mat[1, 3]);
}
set {
mat[0, 3] = value.X;
mat[1, 3] = value.Y;
}
}
public double scale {
get {
return mat[0, 0];
}
set {
mat[0, 0] = value;
mat[1, 1] = value;
}
}
public camera2D() {
mat = new Matrix(Matrix.Identity(4));
}
}
}