コード例 #1
0
        //Update the position, rotation, or scale of the object selections based on the tool handle
        private void EditSelection()
        {
            //Determine which tool was used and call the respective transform
            switch (SelectionHandle.Instance.Tool)
            {
            case Tool.Translate:
                //Get the position displacement and translate the selected objects
                Vector3 posDisplacement = SelectionHandle.Instance.GetPosDisplacement();
                TransformTools.TranslateSelection(Instance.selectedObjects, posDisplacement);

                //Update the selection average
                TranslateSelectionAverage(posDisplacement);
                break;

            case Tool.Rotate:
                //Get the angle and axis and to rotate around
                Vector3 rotationAxis;
                float   angle = SelectionHandle.Instance.GetRotDisplacement(out rotationAxis);

                //Rotate the selected objects around the selection average
                TransformTools.RotateSelection(Instance.selectedObjects, selectionAverage, rotationAxis, angle);
                break;

            case Tool.Scale:
                //Get the scale displacement and scale the selected objects
                Vector3 scaleDisplacement = SelectionHandle.Instance.GetScaleDisplacement();
                TransformTools.ScaleSelection(Instance.selectedObjects, selectionAverage, scaleDisplacement, false);
                break;
            }
        }
コード例 #2
0
            public override void RevertEdit()
            {
                TransformTools.TranslateSelection(Instance.selectedObjects, negativeDisplacement);

                //Update the selection average
                Instance.TranslateSelectionAverage(negativeDisplacement);
                SelectionHandle.Instance.Position = Instance.selectionAverage;
            }
コード例 #3
0
            public override void ExecuteEdit()
            {
                TransformTools.TranslateSelection(Instance.selectedObjects, displacement);

                //Update the selection average
                Instance.TranslateSelectionAverage(displacement);
                SelectionHandle.Instance.Position = Instance.selectionAverage;
            }