AntTweakBar.VectorVariable.SetCallback C# (CSharp) Method

SetCallback() private method

Called by AntTweakBar when the user changes the variable's value.
private SetCallback ( IntPtr pointer, IntPtr clientData ) : void
pointer System.IntPtr
clientData System.IntPtr
return void
        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);
                }
            }
        }