示例#1
0
        private void EntityPivotRotationTextBox_TextChanged(object sender, EventArgs e)
        {
            if (populatingui)
            {
                return;
            }
            if (CurrentEntity == null)
            {
                return;
            }
            Vector4    v = FloatUtil.ParseVector4String(EntityPivotRotationTextBox.Text);
            Quaternion q = new Quaternion(v);

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (CurrentEntity.PivotOrientation != q)
                {
                    CurrentEntity.SetPivotOrientation(q);
                    //SetYmapHasChanged(true);
                    var wf = ProjectForm.WorldForm;
                    if (wf != null)
                    {
                        wf.BeginInvoke(new Action(() =>
                        {
                            bool editpivot     = wf.EditEntityPivot;
                            wf.EditEntityPivot = true;
                            wf.SetWidgetRotation(CurrentEntity.WidgetOrientation, true);
                            wf.EditEntityPivot = editpivot;
                        }));
                    }
                }
            }
        }
示例#2
0
        private void EntityPivotRotationQuatBox_ValueChanged(object sender, EventArgs e)
        {
            if (populatingui)
            {
                return;
            }
            if (CurrentEntity == null)
            {
                return;
            }
            Quaternion q = EntityPivotRotationQuatBox.Value;

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (CurrentEntity.PivotOrientation != q)
                {
                    CurrentEntity.SetPivotOrientation(q);
                    //SetYmapHasChanged(true);
                    var wf = ProjectForm.WorldForm;
                    if (wf != null)
                    {
                        wf.BeginInvoke(new Action(() =>
                        {
                            bool editpivot     = wf.EditEntityPivot;
                            wf.EditEntityPivot = true;
                            wf.SetWidgetRotation(CurrentEntity.WidgetOrientation, true);
                            wf.EditEntityPivot = editpivot;
                        }));
                    }
                }
            }
        }