Ejemplo n.º 1
0
 public static void ToMatrix4x4(MatrixSingle matrix, float *destination)
 {
     Vector.ToVector4D(matrix._v0, &destination[0]);
     Vector.ToVector4D(matrix._v1, &destination[4]);
     Vector.ToVector4D(matrix._v2, &destination[8]);
     Vector.ToVector4D(matrix._v3, &destination[12]);
 }
Ejemplo n.º 2
0
        public unsafe void Setup()
        {
            Trace.Assert(Unsafe.SizeOf <Matrix4>() == Unsafe.SizeOf <MatrixSingle>());
            var openTk1 = new Matrix4();
            var openTk2 = new Matrix4();

            float *p1 = (float *)&openTk1;
            float *p2 = (float *)&openTk2;

            for (var i = 0; i < 4 * 4; i++)
            {
                p1[i] = i;
                p2[i] = 1f / i;
            }

            _openTk1 = openTk1;

            _mathSharp1 = Unsafe.As <Matrix4, MatrixSingle>(ref openTk1);
        }