예제 #1
0
        public AxisMouseRotationSettingsView(AxisMouseRotationSettings settings)
        {
            _settings = settings;

            ToggleVisibilityBeforeRender = true;
            IndentContent = true;
        }
예제 #2
0
        private void RotateObjectAroundAxis()
        {
            AxisMouseRotationSettings axisMouseRotationSettings = _mouseRotationSettings.XAxisRotationSettings;

            if (_rotationAxis == TransformAxis.Y)
            {
                axisMouseRotationSettings = _mouseRotationSettings.YAxisRotationSettings;
            }
            else if (_rotationAxis == TransformAxis.Z)
            {
                axisMouseRotationSettings = _mouseRotationSettings.ZAxisRotationSettings;
            }

            float   rotationAmountInDegrees = MouseCursor.Instance.OffsetSinceLastMouseMove.x * axisMouseRotationSettings.MouseSensitivity;
            Vector3 rotationAxis            = TransformAxes.GetVector(_rotationAxis, TransformSpace.Global, _gameObjectTransform);

            RotateObjectAroundAxis(rotationAxis, rotationAmountInDegrees);
        }