<commit_before>extern crate camera_controllers;
extern crate cgmath;
extern crate collision;
extern crate fps_counter;
extern crate gfx;
extern crate gfx_smaa;
extern crate gfx_text;
extern crate piston_window;
extern crate terra;
extern crate vecmath;

use std::time::Instant;

use fps_counter::FPSCounter;
use piston_window::*;
use camera_controllers::{Camera, FirstPerson, FirstPersonSettings};
use collision::Frustum;
use cgmath::*;
use vecmath::vec3_dot;

use terra::{QuadTreeBuilder, TextureQuality, VertexQuality};

fn compute_projection_matrix(w: &PistonWindow) -> Matrix4<f32> {
    let draw_size = w.window.draw_size();
    PerspectiveFov {
        fovy: Rad((90.0f32 * 9.0 / 16.0).to_radians()),
        near: 100.0,
        far: 50000000.0,
        aspect: (draw_size.width as f32) / (draw_size.height as f32),
    }.into()
}

fn compute_view_matrix(c: Camera) -> Matrix4<f32> {
    let p = c.position;
    let r = c.right;
    let u = c.up;
    let f = c.forward;

    #[cfg_attr(rustfmt, rustfmt_skip)]
    Matrix4::new(
        r[0], u[0], f[0], 0.0,
        r[1], u[1], f[1], 0.0,
        r[2], u[2], f[2], 0.0,
        -vec3_dot(r, p), -vec3_dot(u, p), -vec3_dot(f, p), 1.0,
    )
}

fn main() {
    let mut window: PistonWindow = PistonWindow::new(
        OpenGL::V3_3,
        0,
        WindowSettings::new("terra preview", [1920, 1080])
            .exit_on_esc(true)
            .opengl(OpenGL::V3_3)
            .vsync(false)
            // .srgb(false)<commit_msg>Closer near plane<commit_after>extern crate camera_controllers;
extern crate cgmath;
extern crate collision;
extern crate fps_counter;
extern crate gfx;
extern crate gfx_smaa;
extern crate gfx_text;
extern crate piston_window;
extern crate terra;
extern crate vecmath;

use std::time::Instant;

use fps_counter::FPSCounter;
use piston_window::*;
use camera_controllers::{Camera, FirstPerson, FirstPersonSettings};
use collision::Frustum;
use cgmath::*;
use vecmath::vec3_dot;

use terra::{QuadTreeBuilder, TextureQuality, VertexQuality};

fn compute_projection_matrix(w: &PistonWindow) -> Matrix4<f32> {
    let draw_size = w.window.draw_size();
    PerspectiveFov {
        fovy: Rad((90.0f32 * 9.0 / 16.0).to_radians()),
        near: 10.0,
        far: 50000000.0,
        aspect: (draw_size.width as f32) / (draw_size.height as f32),
    }.into()
}

fn compute_view_matrix(c: Camera) -> Matrix4<f32> {
    let p = c.position;
    let r = c.right;
    let u = c.up;
    let f = c.forward;

    #[cfg_attr(rustfmt, rustfmt_skip)]
    Matrix4::new(
        r[0], u[0], f[0], 0.0,
        r[1], u[1], f[1], 0.0,
        r[2], u[2], f[2], 0.0,
        -vec3_dot(r, p), -vec3_dot(u, p), -vec3_dot(f, p), 1.0,
    )
}

fn main() {
    let mut window: PistonWindow = PistonWindow::new(
        OpenGL::V3_3,
        0,
        WindowSettings::new("terra preview", [1920, 1080])
            .exit_on_esc(true)
            .opengl(OpenGL::V3_3)
            .vsync(false)
            // .srgb(false)
{'fraction_non_alphanumeric': 0.14625964441462597, 'fraction_numerical': 0.04528681650452868, 'mean_word_length': 3.057142857142857, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5858064', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1126, 'n_words': 259}