Bug in CameraController.AddRotateForce(double dx, double dy)

Feb 19, 2012 at 11:16 AM

Hello,

the method CameraController.AddRotateForce(double dx, double dy) always works as CameraMode.Inspect.

In my case, I have CameraMode set to WalkAround, which works fine for mouse controls, but keyboard control is wrong in that case.

 

I changed the method to

        public void AddRotateForce(double dx, double dy)
        {
            if (!this.IsRotationEnabled)
            {
                return;
            }

            this.PushCameraSetting();

            if (this.CameraMode == CameraMode.WalkAround)
            {
                this.rotationPoint3D = this.CameraPosition;
            }
            else
            {
                this.rotationPoint3D = this.CameraTarget;
            }
            this.rotationPosition = new Point(this.ActualWidth / 2, this.ActualHeight / 2);
            this.rotationSpeed.X += dx * 40;
            this.rotationSpeed.Y += dy * 40;
        }

 

which does kind of work, but rotating left/right via keyboard is inverted compared to mouse control.

What is the reason for the inverted controls?

 

Best Regards

Bernd

 

btw: Just downloaded the latest source code and changing the CameraMode in CameraControlDemo does not work anymore.

Feb 21, 2012 at 8:59 PM

thanks for the feedback! I have only used the "Inspect" mode recently, it seems like the "Walkaround" mode is not working properly. I added it as issue 9949!

Feb 22, 2012 at 8:08 AM

Thank you.