Beispiel #1
0
        internal static void setWindows(OpenTK.GameWindow window)
        {
            Window = window;

            _mouse       = window.Mouse;
            _mouse.Move += HandleWindowMouseMove;
        }
Beispiel #2
0
        public void updateCamera(OpenTK.Input.KeyboardDevice keyboard, OpenTK.Input.MouseDevice mouse)
        {
            const float speed      = 1.0f;
            const float mouseSpeed = 0.5f;

            camAngle.Y += mouse.XDelta * mouseSpeed;
            camAngle.X += mouse.YDelta * mouseSpeed;

            Vector2 RadAng = new Vector2();

            RadAng.X = (camAngle.X / 180 * Math.PI);
            RadAng.Y = (camAngle.Y / 180 * Math.PI);


            if (keyboard[OpenTK.Input.Key.W])
            {
                camCoord.X -= (float)(Math.Sin(RadAng.Y) * speed);
                camCoord.Z += (float)(Math.Cos(RadAng.Y) * speed);
                camCoord.Y += (float)(Math.Sin(RadAng.X) * speed);
            }
            if (keyboard[OpenTK.Input.Key.S])
            {
                camCoord.X += (float)(Math.Sin(RadAng.Y) * speed);
                camCoord.Z -= (float)(Math.Cos(RadAng.Y) * speed);
                camCoord.Y -= (float)(Math.Sin(RadAng.X) * speed);
            }
            if (keyboard[OpenTK.Input.Key.D])
            {
                camCoord.X -= (float)(Math.Cos(RadAng.Y) * speed);
                camCoord.Z -= (float)(Math.Sin(RadAng.Y) * speed);
            }
            if (keyboard[OpenTK.Input.Key.A])
            {
                camCoord.X += (float)(Math.Cos(RadAng.Y) * speed);
                camCoord.Z += (float)(Math.Sin(RadAng.Y) * speed);
            }

            if (camAngle.X > 89)
            {
                camAngle.X = 89;
            }
            if (camAngle.X < -89)
            {
                camAngle.X = -89;
            }

            if (camAngle.Y > 360)
            {
                camAngle.Y -= 360;
            }
            else if (camAngle.Y < 0)
            {
                camAngle.Y += 360;
            }
        }
Beispiel #3
0
 internal static void setWindows(OpenTK.GameWindow window)
 {
     Window = window;
     _mouse = window.Mouse;
 }
Beispiel #4
0
 internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse)
 {
     _mouse = mouse;
 }
Beispiel #5
0
 public MouseDevice(OpenTK.Input.MouseDevice dev)
 {
     this.dev = dev;
 }
Beispiel #6
0
		internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse)
		{
			_mouse = mouse;
			_mouse.Move += HandleWindowMouseMove;
		}
Beispiel #7
0
 public GLMouse(OpenTK.Input.MouseDevice idev)
 {
     realmouse = idev;
     realmouse.Move += new EventHandler<OpenTK.Input.MouseMoveEventArgs>(realmouse_Move);
     realmouse.ButtonDown+= HandleRealmouseButtonDown;
     realmouse.ButtonUp+= HandleRealmouseButtonUp;
 }
Beispiel #8
0
 internal MouseDevice(tkMouseDevice mouseDevice)
 {
     this.mouseDevice = mouseDevice;
 }
Beispiel #9
0
		internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse)
		{
			_mouse = mouse;
		}
Beispiel #10
0
 internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse)
 {
     _mouse       = mouse;
     _mouse.Move += HandleWindowMouseMove;
 }