internal static void setWindows(OpenTK.GameWindow window) { Window = window; _mouse = window.Mouse; _mouse.Move += HandleWindowMouseMove; }
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; } }
internal static void setWindows(OpenTK.GameWindow window) { Window = window; _mouse = window.Mouse; }
internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse) { _mouse = mouse; }
public MouseDevice(OpenTK.Input.MouseDevice dev) { this.dev = dev; }
internal static void UpdateMouseInfo(OpenTK.Input.MouseDevice mouse) { _mouse = mouse; _mouse.Move += HandleWindowMouseMove; }
public GLMouse(OpenTK.Input.MouseDevice idev) { realmouse = idev; realmouse.Move += new EventHandler<OpenTK.Input.MouseMoveEventArgs>(realmouse_Move); realmouse.ButtonDown+= HandleRealmouseButtonDown; realmouse.ButtonUp+= HandleRealmouseButtonUp; }
internal MouseDevice(tkMouseDevice mouseDevice) { this.mouseDevice = mouseDevice; }