static void Peek(mat4stack256 that, out ovrMatrix4f value) { var offset = that.__offset * 4 * 4; fixed(float *__value_M = value.M) //fixed (float* __value = that.__value) { //fixed ( &that.__value //fixed (that) //var current = &__value[offset]; //var current_ovrMatrix4f = (ovrMatrix4f*)current; //// copy our floats out //value = *current_ovrMatrix4f; //jni/OVRWindWheelNDK.dll.c:354:16: error: incompatible types when assigning to type 'ovrMatrix4f' from type 'struct ovrMatrix4f *' // (*(value)) = matrix4f_3; // lets do a slower copy? for (int i = 0; i < 4 * 4; i++) { //var f = __value[offset + i]; var f = that.__value[offset + i]; // Error 19 You cannot use fixed size buffers contained in unfixed expressions. Try using the fixed statement. X:\jsc.svn\examples\java\android\vr\OVRWindWheelNDK\OVRWindWheelNDK\Library\Matrix4x4Stack.cs 92 21 OVRWindWheelNDK //value.M[i] = f; __value_M[i] = f; } } }
// https://sites.google.com/a/jsc-solutions.net/work/knowledge-base/15-dualvr/20150717/matrix4x4 // X:\jsc.svn\core\ScriptCoreLib\Shared\BCLImplementation\System\Numerics\Matrix4x4.cs static void Push(mat4stack256 that, ref ovrMatrix4f value) { that.__offset++; fixed (float* __value_M = value.M) //fixed (float* __value = that.__value) { //fixed ( &that.__value //fixed (that) //var current = &__value[offset]; //var current_ovrMatrix4f = (ovrMatrix4f*)current; //// copy our floats out //value = *current_ovrMatrix4f; //jni/OVRWindWheelNDK.dll.c:354:16: error: incompatible types when assigning to type 'ovrMatrix4f' from type 'struct ovrMatrix4f *' // (*(value)) = matrix4f_3; // lets do a slower copy? for (int i = 0; i < 4 * 4; i++) { //var f = __value[offset + i]; //var f = that.__value[offset + i]; //// Error 19 You cannot use fixed size buffers contained in unfixed expressions. Try using the fixed statement. X:\jsc.svn\examples\java\android\vr\OVRWindWheelNDK\OVRWindWheelNDK\Library\Matrix4x4Stack.cs 92 21 OVRWindWheelNDK ////value.M[i] = f; //__value_M[i] = f; //var f = value.M[i]; var f = __value_M[i]; that.__value[that.__offset + i] = f; } } }