projects
/
mandelwow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Run 'cargo fix --edition'
[mandelwow.git]
/
support
/
camera.rs
diff --git
a/support/camera.rs
b/support/camera.rs
index b31b9e33c47d79e382e180f9feb5e0f3d8147fd3..5ae1c8c762be67db17a0d3bfa880f21c9c05a33e 100644
(file)
--- a/
support/camera.rs
+++ b/
support/camera.rs
@@
-1,13
+1,11
@@
-extern crate glutin;
-
use cgmath::{Matrix4, Vector4};
use cgmath::conv::array4x4;
use cgmath::{Matrix4, Vector4};
use cgmath::conv::array4x4;
-use gl
utin::WindowEvent::{KeyboardInput, CursorMoved}
;
-use glutin::VirtualKeyCode;
+use gl
ium
;
+use gl
ium::gl
utin::VirtualKeyCode;
use std::f32;
use std::f32::consts::PI;
use std::f32;
use std::f32::consts::PI;
-use support::vec3::Vec3;
-use support::vec3::norm;
+use
crate::
support::vec3::Vec3;
+use
crate::
support::vec3::norm;
#[derive(Default)]
pub struct CameraState {
#[derive(Default)]
pub struct CameraState {
@@
-165,10
+163,10
@@
impl CameraState {
//println!("camera_dir = {:?}", self.dir);
}
//println!("camera_dir = {:?}", self.dir);
}
- pub fn process_input(&mut self, event: &glutin::WindowEvent) {
+ pub fn process_input(&mut self, event: &gl
ium::gl
utin::WindowEvent) {
match event {
match event {
- &
CursorMoved { position: (x, y)
, .. } => {
- let (x, y) = (
x as i32,
y as i32);
+ &
glium::glutin::WindowEvent::CursorMoved { position
, .. } => {
+ let (x, y) = (
position.x as i32, position.
y as i32);
if self.mouse_x == -1 {
// Set initial absolute position.
self.mouse_x = x;
if self.mouse_x == -1 {
// Set initial absolute position.
self.mouse_x = x;
@@
-179,8
+177,8
@@
impl CameraState {
self.mouse_x = x;
self.mouse_y = y;
}
self.mouse_x = x;
self.mouse_y = y;
}
- &KeyboardInput { input, .. } => {
- let pressed = input.state == glutin::ElementState::Pressed;
+ &
glium::glutin::WindowEvent::
KeyboardInput { input, .. } => {
+ let pressed = input.state == gl
ium::gl
utin::ElementState::Pressed;
let key = match input.virtual_keycode {
Some(key) => key,
None => return,
let key = match input.virtual_keycode {
Some(key) => key,
None => return,