private void SetCallback(IntPtr pointer, IntPtr clientData)
{
float[] data = new float[3]; /* X, Y, Z */
Marshal.Copy(pointer, data, 0, data.Length);
if (IsValid(data[0], data[1], data[2]))
{
bool changed = (data[0] != x)
|| (data[1] != y)
|| (data[2] != z);
x = data[0];
y = data[1];
z = data[2];
if (changed) {
OnChanged(EventArgs.Empty);
}
}
}