Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another camera Shifting bug update #252

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use piston::event_loop::{ Events, EventLoop };
use flate2::read::GzDecoder;
use sdl2_window::Sdl2Window;
use shader::Renderer;
use vecmath::{ vec3_add, vec3_scale, vec3_normalized };
use vecmath::{ vec3_add, vec3_scale};
use piston::window::{ Size, Window, AdvancedWindow, OpenGLWindow,
WindowSettings };

Expand Down Expand Up @@ -210,14 +210,6 @@ fn main() {
// Apply the same y/z camera offset vanilla minecraft has.
let mut camera = first_person.camera(0.0);
camera.position[1] += 1.62;
let mut xz_forward = camera.forward;
xz_forward[1] = 0.0;
xz_forward = vec3_normalized(xz_forward);
camera.position = vec3_add(
camera.position,
vec3_scale(xz_forward, 0.0)
);

let view_mat = camera.orthogonal();
renderer.set_view(view_mat);
renderer.clear();
Expand Down