Beispiel #1
0
 public Matrix3x3(Matrix3x3 Other)
 {
     M00 = Other.M00;
     M01 = Other.M01;
     M02 = Other.M02;
     M10 = Other.M10;
     M11 = Other.M11;
     M12 = Other.M12;
     M20 = Other.M20;
     M21 = Other.M21;
     M22 = Other.M22;
 }
Beispiel #2
0
 public Matrix3x3 Translate(float x, float y)
 {
     return (this *= new Matrix3x3(1, 0, x, 0, 1, y, 0, 0, 1));
 }
Beispiel #3
0
 public Matrix3x3 Set(Matrix3x3 Other)
 {
     M00 = Other.M00;
     M01 = Other.M01;
     M02 = Other.M02;
     M10 = Other.M10;
     M11 = Other.M11;
     M12 = Other.M12;
     M20 = Other.M20;
     M21 = Other.M21;
     M22 = Other.M22;
     return this;
 }
Beispiel #4
0
 public Matrix3x3 Scale(float x, float y)
 {
     return (this *= new Matrix3x3(x, 0, 0, 0, y, 0, 0, 0, 1));
 }
Beispiel #5
0
 public Matrix3x3 Rotate(float rad)
 {
     float s = (float)Math.Sin(rad);
     float c = (float)Math.Cos(rad);
     return (this *= new Matrix3x3(c, -s, 0, s, c, 0, 0, 0, 1));
 }
Beispiel #6
0
 public static Matrix3x3 operator *(Matrix3x3 a, Matrix3x3 b)
 {
     Matrix3x3 r = new Matrix3x3();
     for (int y = 0; y < 3; y++)
         for (int x = 0; x < 3; x++)
             r[x, y] = (a[x, 0] * b[0, y]) + (a[x, 1] * b[1, y]) + (a[x, 2] * b[2, y]);
     return r;
 }