19 x = BitConverter.ToSingle(message, 0),
20 y = BitConverter.ToSingle(message,
sizeof(
float)),
21 z = BitConverter.ToSingle(message,
sizeof(
float) * 2)
31 byte[] msg =
new byte[12];
33 byte[] valsx = BitConverter.GetBytes(vector3.x);
34 byte[] valsy = BitConverter.GetBytes(vector3.y);
35 byte[] valsz = BitConverter.GetBytes(vector3.z);
36 for (
int j = 0; j < 4; j++)
39 msg[4 + j] = valsy[j];
40 msg[8 + j] = valsz[j];
53 x = BitConverter.ToSingle(message, 0),
54 y = BitConverter.ToSingle(message,
sizeof(
float)),
55 z = BitConverter.ToSingle(message,
sizeof(
float) * 2),
56 w = BitConverter.ToSingle(message,
sizeof(
float) * 3)
66 byte[] msg =
new byte[16];
68 byte[] valsx = BitConverter.GetBytes(vector3.x);
69 byte[] valsy = BitConverter.GetBytes(vector3.y);
70 byte[] valsz = BitConverter.GetBytes(vector3.z);
71 byte[] valsw = BitConverter.GetBytes(vector3.w);
72 for (
int j = 0; j < 4; j++)
75 msg[4 + j] = valsy[j];
76 msg[8 + j] = valsz[j];
77 msg[12 + j] = valsw[j];
This class is a purely static utility class that contains helper functions for CoreLink data parsing.
static byte[] quaternionToBytes(Quaternion vector3)
Converts a Vector3 into bytes to send via CoreLink.
static Vector3 bytesToVector3(byte[] message)
Converts a corelink message byte array into a Vector3.
static Quaternion bytesToQuaternion(byte[] message)
Converts a corelink message byte array into a Quaternion.
static byte[] vector3ToBytes(Vector3 vector3)
Converts a Vector3 into bytes to send via CoreLink.