Exemplo n.º 1
0
        internal static void setWindows(OpenTK.GameWindow window)
        {
            Window = window;

            _mouse       = window.Mouse;
            _mouse.Move += HandleWindowMouseMove;
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 3
0
 internal static void setWindows(OpenTK.GameWindow window)
 {
     Window = window;
     _mouse = window.Mouse;
 }
Exemplo n.º 4
0
 internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse)
 {
     _mouse = mouse;
 }
Exemplo n.º 5
0
 public MouseDevice(OpenTK.Input.MouseDevice dev)
 {
     this.dev = dev;
 }
Exemplo n.º 6
0
		internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse)
		{
			_mouse = mouse;
			_mouse.Move += HandleWindowMouseMove;
		}
Exemplo n.º 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;
 }
Exemplo n.º 8
0
 internal MouseDevice(tkMouseDevice mouseDevice)
 {
     this.mouseDevice = mouseDevice;
 }
Exemplo n.º 9
0
		internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse)
		{
			_mouse = mouse;
		}
Exemplo n.º 10
0
 internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse)
 {
     _mouse       = mouse;
     _mouse.Move += HandleWindowMouseMove;
 }