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

            _mouse       = window.Mouse;
            _mouse.Move += HandleWindowMouseMove;
        }
示例#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;
            }
        }
示例#3
0
 internal static void setWindows(OpenTK.GameWindow window)
 {
     Window = window;
     _mouse = window.Mouse;
 }
示例#4
0
文件: Mouse.cs 项目: jordoh/MonoGame
 internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse)
 {
     _mouse = mouse;
 }
示例#5
0
 public MouseDevice(OpenTK.Input.MouseDevice dev)
 {
     this.dev = dev;
 }
示例#6
0
文件: Mouse.cs 项目: ncoder/MonoGame
		internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse)
		{
			_mouse = mouse;
			_mouse.Move += HandleWindowMouseMove;
		}
示例#7
0
文件: Class1.cs 项目: IDWMaster/3DAPI
 public GLMouse(OpenTK.Input.MouseDevice idev)
 {
     realmouse = idev;
     realmouse.Move += new EventHandler<OpenTK.Input.MouseMoveEventArgs>(realmouse_Move);
     realmouse.ButtonDown+= HandleRealmouseButtonDown;
     realmouse.ButtonUp+= HandleRealmouseButtonUp;
 }
示例#8
0
 internal MouseDevice(tkMouseDevice mouseDevice)
 {
     this.mouseDevice = mouseDevice;
 }
示例#9
0
		internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse)
		{
			_mouse = mouse;
		}
示例#10
0
 internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse)
 {
     _mouse       = mouse;
     _mouse.Move += HandleWindowMouseMove;
 }