예제 #1
0
        public sealed override void UpdateMapping(RyneCamera camera, EditAxis axis)
        {
            Float3 xAxis, yAxis;

            if (axis == EditAxis.All)
            {
                xAxis = new Float3(1, 0, 0);
                yAxis = new Float3(0, 1, 0);
            }
            else
            {
                xAxis = AxisToFloat3(axis);
                yAxis = xAxis;
            }

            MouseAxisInputs[0] = new MouseAxisInput {
                Axis = new Float2(1, 0), Action = new InputScalingAction(xAxis, Speed)
            };
            MouseAxisInputs[1] = new MouseAxisInput {
                Axis = new Float2(0, 1), Action = new InputScalingAction(yAxis, Speed)
            };
        }
예제 #2
0
        public sealed override void UpdateMapping(RyneCamera camera, EditAxis axis)
        {
            Float3 xAxis, yAxis;

            if (axis == EditAxis.All)
            {
                // Set axes from plane tangents relative to camera
                Float3 planeNormal = (camera.Focus - new Float3(camera.GetPosition())).Normalize();
                xAxis = planeNormal.Cross(camera.Up).Normalize() * -1.0f;
                yAxis = xAxis.Cross(planeNormal).Normalize();
            }
            else
            {
                xAxis = AxisToFloat3(axis);
                yAxis = xAxis;
            }

            MouseAxisInputs[0] = new MouseAxisInput {
                Axis = new Float2(1, 0), Action = new InputMovementAction(xAxis, Speed, false)
            };
            MouseAxisInputs[1] = new MouseAxisInput {
                Axis = new Float2(0, 1), Action = new InputMovementAction(yAxis, Speed, false)
            };
        }