Created
March 10, 2020 14:20
-
-
Save aevitas/17fa52a4b222f09bc58c79564e5379ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static unsafe byte[] GetVectorBytes(Vector3 vec) | |
{ | |
var buffer = new byte[sizeof(Vector3)]; | |
fixed (byte* b = buffer) | |
{ | |
Marshal.StructureToPtr(vec, new IntPtr(b), false); | |
return buffer; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment