Permalink
Browse files

Style: 2 spaces -> 4 spaces

  • Loading branch information...
1 parent b61d286 commit e007c224857a703f5aaf3c232419c043ef4bcf87 @ozkriff committed Feb 19, 2014
Showing with 1,100 additions and 1,089 deletions.
  1. +9 −9 .travis.yml
  2. +1 −1 Makefile
  3. +39 −39 camera.rs
  4. +2 −2 config.json
  5. +137 −133 core.rs
  6. +3 −3 core_types.rs
  7. +78 −78 event_visualizer.rs
  8. +42 −42 geom.rs
  9. +175 −174 gl_helpers.rs
  10. +11 −11 gl_types.rs
  11. +6 −6 main.rs
  12. +23 −23 map.rs
  13. +65 −65 mesh.rs
  14. +8 −8 misc.rs
  15. +2 −2 normal.fs.glsl
  16. +4 −4 normal.vs.glsl
  17. +95 −95 obj.rs
  18. +2 −2 pick.fs.glsl
  19. +4 −4 pick.vs.glsl
  20. +106 −102 tile_picker.rs
  21. +288 −286 visualizer.rs
View
@@ -1,19 +1,19 @@
# See LICENSE file for copyright and license details.
before_install:
- - sudo add-apt-repository -y ppa:hansjorg/rust
- - sudo apt-get update
+ - sudo add-apt-repository -y ppa:hansjorg/rust
+ - sudo apt-get update
install:
- - sudo apt-get install rust-nightly
- - sudo apt-get install libXxf86vm-dev
+ - sudo apt-get install rust-nightly
+ - sudo apt-get install libXxf86vm-dev
- # Download, build and install dependencies
- - ./make_deps.sh
+ # Download, build and install dependencies
+ - ./make_deps.sh
- - git clone --depth=1 https://github.com/ozkriff/marauder-data data
+ - git clone --depth=1 https://github.com/ozkriff/marauder-data data
script:
- - make
+ - make
-# vim: set tabstop=2 shiftwidth=2 softtabstop=2 expandtab:
+# vim: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab:
View
@@ -31,4 +31,4 @@ marauder: Makefile ${SRC}
clean:
rm -f marauder
-# vim: set tabstop=2 shiftwidth=2 softtabstop=2 expandtab:
+# vim: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab:
View
@@ -1,8 +1,8 @@
// See LICENSE file for copyright and license details.
use std::num::{
- sin,
- cos,
+ sin,
+ cos,
};
use cgmath::projection;
use cgmath::angle;
@@ -11,54 +11,54 @@ use cgmath::vector::Vec3;
use glh = gl_helpers;
use misc::deg_to_rad;
use gl_types::{
- Float,
- WorldPos,
+ Float,
+ WorldPos,
};
pub struct Camera {
- x_angle: Float,
- z_angle: Float,
- pos: WorldPos,
- zoom: Float,
- projection_mat: Mat4<Float>,
+ x_angle: Float,
+ z_angle: Float,
+ pos: WorldPos,
+ zoom: Float,
+ projection_mat: Mat4<Float>,
}
fn get_projection_mat() -> Mat4<Float> {
- let fov = angle::deg(45.0 as Float);
- let ratio = 4.0 / 3.0;
- let display_range_min = 0.1;
- let display_range_max = 100.0;
- projection::perspective(
- fov, ratio, display_range_min, display_range_max)
+ let fov = angle::deg(45.0 as Float);
+ let ratio = 4.0 / 3.0;
+ let display_range_min = 0.1;
+ let display_range_max = 100.0;
+ projection::perspective(
+ fov, ratio, display_range_min, display_range_max)
}
impl Camera {
- pub fn new() -> Camera {
- Camera {
- x_angle: 45.0,
- z_angle: 0.0,
- pos: Vec3::zero(),
- zoom: 10.0,
- projection_mat: get_projection_mat(),
+ pub fn new() -> Camera {
+ Camera {
+ x_angle: 45.0,
+ z_angle: 0.0,
+ pos: Vec3::zero(),
+ zoom: 10.0,
+ projection_mat: get_projection_mat(),
+ }
}
- }
- pub fn mat(&self) -> Mat4<Float> {
- let mut mvp_mat = self.projection_mat;
- mvp_mat = glh::tr(mvp_mat, Vec3{x: 0.0, y: 0.0, z: -self.zoom});
- mvp_mat = glh::rot_x(mvp_mat, -self.x_angle);
- mvp_mat = glh::rot_z(mvp_mat, -self.z_angle);
- mvp_mat = glh::tr(mvp_mat, self.pos);
- mvp_mat
- }
+ pub fn mat(&self) -> Mat4<Float> {
+ let mut mvp_mat = self.projection_mat;
+ mvp_mat = glh::tr(mvp_mat, Vec3{x: 0.0, y: 0.0, z: -self.zoom});
+ mvp_mat = glh::rot_x(mvp_mat, -self.x_angle);
+ mvp_mat = glh::rot_z(mvp_mat, -self.z_angle);
+ mvp_mat = glh::tr(mvp_mat, self.pos);
+ mvp_mat
+ }
- pub fn move(&mut self, angle: Float) {
- let speed_in_radians = deg_to_rad(self.z_angle - angle);
- let dx = sin(speed_in_radians);
- let dy = cos(speed_in_radians);
- self.pos.x -= dy;
- self.pos.y -= dx;
- }
+ pub fn move(&mut self, angle: Float) {
+ let speed_in_radians = deg_to_rad(self.z_angle - angle);
+ let dx = sin(speed_in_radians);
+ let dy = cos(speed_in_radians);
+ self.pos.x -= dy;
+ self.pos.y -= dx;
+ }
}
-// vim: set tabstop=2 shiftwidth=2 softtabstop=2 expandtab:
+// vim: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab:
View
@@ -1,4 +1,4 @@
{
- "x": 640,
- "y": 480
+ "x": 640,
+ "y": 480
}
Oops, something went wrong.

0 comments on commit e007c22

Please sign in to comment.