From c8f5bf9e19cde42c2bbff7ad87f00e5ffdb608c6 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Thu, 7 Feb 2019 16:36:55 -0800 Subject: [PATCH] cargo fix --edition and add edition="2018" to Cargo.toml. --- rtiow/Cargo.toml | 2 ++ rtiow/src/aabb.rs | 4 +-- rtiow/src/bvh.rs | 22 +++++++------- rtiow/src/camera.rs | 6 ++-- rtiow/src/constant_medium.rs | 14 ++++----- rtiow/src/cuboid.rs | 22 +++++++------- rtiow/src/flip_normals.rs | 8 +++--- rtiow/src/hitable.rs | 8 +++--- rtiow/src/hitable_list.rs | 12 ++++---- rtiow/src/kdtree.rs | 10 +++---- rtiow/src/material.rs | 12 ++++---- rtiow/src/moving_sphere.rs | 18 ++++++------ rtiow/src/noise/lode.rs | 4 +-- rtiow/src/noise/mod.rs | 2 +- rtiow/src/noise/perlin.rs | 6 ++-- rtiow/src/ray.rs | 2 +- rtiow/src/rect.rs | 12 ++++---- rtiow/src/renderer.rs | 12 ++++---- rtiow/src/rotate.rs | 10 +++---- rtiow/src/scenes/bench.rs | 22 +++++++------- rtiow/src/scenes/book.rs | 30 +++++++++---------- rtiow/src/scenes/bvh.rs | 22 +++++++------- rtiow/src/scenes/cornell_box.rs | 34 +++++++++++----------- rtiow/src/scenes/cornell_smoke.rs | 38 ++++++++++++------------ rtiow/src/scenes/final_scene.rs | 48 +++++++++++++++---------------- rtiow/src/scenes/perlin_debug.rs | 26 ++++++++--------- rtiow/src/scenes/test.rs | 36 +++++++++++------------ rtiow/src/scenes/tutorial.rs | 24 ++++++++-------- rtiow/src/sphere.rs | 14 ++++----- rtiow/src/texture/checker.rs | 4 +-- rtiow/src/texture/constant.rs | 4 +-- rtiow/src/texture/envmap.rs | 6 ++-- rtiow/src/texture/image.rs | 4 +-- rtiow/src/texture/mod.rs | 12 ++++---- rtiow/src/texture/noise.rs | 8 +++--- rtiow/src/translate.rs | 10 +++---- 36 files changed, 265 insertions(+), 263 deletions(-) diff --git a/rtiow/Cargo.toml b/rtiow/Cargo.toml index d3a1759..f55716e 100644 --- a/rtiow/Cargo.toml +++ b/rtiow/Cargo.toml @@ -2,6 +2,8 @@ name = "rtiow" version = "0.1.0" authors = ["Bill Thiede "] +edition = "2018" + [dependencies] rand = "0.5.5" diff --git a/rtiow/src/aabb.rs b/rtiow/src/aabb.rs index 2b98667..50ee3bc 100644 --- a/rtiow/src/aabb.rs +++ b/rtiow/src/aabb.rs @@ -1,7 +1,7 @@ use std::fmt; -use ray::Ray; -use vec3::Vec3; +use crate::ray::Ray; +use crate::vec3::Vec3; #[derive(Debug, Clone, PartialEq)] pub struct AABB { diff --git a/rtiow/src/bvh.rs b/rtiow/src/bvh.rs index 1eff02c..e792857 100644 --- a/rtiow/src/bvh.rs +++ b/rtiow/src/bvh.rs @@ -5,11 +5,11 @@ use std::time::Instant; use rand; use rand::Rng; -use aabb::surrounding_box; -use aabb::AABB; -use hitable::Hit; -use hitable::HitRecord; -use ray::Ray; +use crate::aabb::surrounding_box; +use crate::aabb::AABB; +use crate::hitable::Hit; +use crate::hitable::HitRecord; +use crate::ray::Ray; enum BVHNode { Leaf(Box), @@ -229,12 +229,12 @@ impl Hit for BVH { #[cfg(test)] mod tests { - use aabb::AABB; - use material::Lambertian; - use material::Metal; - use sphere::Sphere; - use texture::ConstantTexture; - use vec3::Vec3; + use crate::aabb::AABB; + use crate::material::Lambertian; + use crate::material::Metal; + use crate::sphere::Sphere; + use crate::texture::ConstantTexture; + use crate::vec3::Vec3; use super::*; diff --git a/rtiow/src/camera.rs b/rtiow/src/camera.rs index c2a22ab..38c6289 100644 --- a/rtiow/src/camera.rs +++ b/rtiow/src/camera.rs @@ -3,9 +3,9 @@ use std::f32::consts::PI; use self::rand::Rng; -use ray::Ray; -use vec3::cross; -use vec3::Vec3; +use crate::ray::Ray; +use crate::vec3::cross; +use crate::vec3::Vec3; fn random_in_unit_disk() -> Vec3 { let mut rng = rand::thread_rng(); diff --git a/rtiow/src/constant_medium.rs b/rtiow/src/constant_medium.rs index 13b22a8..ae44f84 100644 --- a/rtiow/src/constant_medium.rs +++ b/rtiow/src/constant_medium.rs @@ -3,13 +3,13 @@ use std; use rand; use rand::Rng; -use aabb::AABB; -use hitable::Hit; -use hitable::HitRecord; -use material::Isotropic; -use ray::Ray; -use texture::Texture; -use vec3::Vec3; +use crate::aabb::AABB; +use crate::hitable::Hit; +use crate::hitable::HitRecord; +use crate::material::Isotropic; +use crate::ray::Ray; +use crate::texture::Texture; +use crate::vec3::Vec3; pub struct ConstantMedium where diff --git a/rtiow/src/cuboid.rs b/rtiow/src/cuboid.rs index 2be78c1..8b4080f 100644 --- a/rtiow/src/cuboid.rs +++ b/rtiow/src/cuboid.rs @@ -1,16 +1,16 @@ use std::sync::Arc; -use aabb::AABB; -use flip_normals::FlipNormals; -use hitable::Hit; -use hitable::HitRecord; -use hitable_list::HitableList; -use material::Material; -use ray::Ray; -use rect::XYRect; -use rect::XZRect; -use rect::YZRect; -use vec3::Vec3; +use crate::aabb::AABB; +use crate::flip_normals::FlipNormals; +use crate::hitable::Hit; +use crate::hitable::HitRecord; +use crate::hitable_list::HitableList; +use crate::material::Material; +use crate::ray::Ray; +use crate::rect::XYRect; +use crate::rect::XZRect; +use crate::rect::YZRect; +use crate::vec3::Vec3; pub struct Cuboid { p_min: Vec3, diff --git a/rtiow/src/flip_normals.rs b/rtiow/src/flip_normals.rs index d7586aa..6a2bcc7 100644 --- a/rtiow/src/flip_normals.rs +++ b/rtiow/src/flip_normals.rs @@ -1,7 +1,7 @@ -use aabb::AABB; -use hitable::Hit; -use hitable::HitRecord; -use ray::Ray; +use crate::aabb::AABB; +use crate::hitable::Hit; +use crate::hitable::HitRecord; +use crate::ray::Ray; pub struct FlipNormals where diff --git a/rtiow/src/hitable.rs b/rtiow/src/hitable.rs index 6fa7405..512baa9 100644 --- a/rtiow/src/hitable.rs +++ b/rtiow/src/hitable.rs @@ -1,9 +1,9 @@ use std::sync::Arc; -use aabb::AABB; -use material::Material; -use ray::Ray; -use vec3::Vec3; +use crate::aabb::AABB; +use crate::material::Material; +use crate::ray::Ray; +use crate::vec3::Vec3; pub struct HitRecord<'m> { pub t: f32, diff --git a/rtiow/src/hitable_list.rs b/rtiow/src/hitable_list.rs index 309da9c..a0b37d8 100644 --- a/rtiow/src/hitable_list.rs +++ b/rtiow/src/hitable_list.rs @@ -1,11 +1,11 @@ use std; -use aabb::surrounding_box; -use aabb::AABB; -use hitable::Hit; -use hitable::HitRecord; -use ray::Ray; -use vec3::Vec3; +use crate::aabb::surrounding_box; +use crate::aabb::AABB; +use crate::hitable::Hit; +use crate::hitable::HitRecord; +use crate::ray::Ray; +use crate::vec3::Vec3; #[derive(Default)] pub struct HitableList { diff --git a/rtiow/src/kdtree.rs b/rtiow/src/kdtree.rs index 73b9fd3..a0e4f2e 100644 --- a/rtiow/src/kdtree.rs +++ b/rtiow/src/kdtree.rs @@ -1,10 +1,10 @@ use std::fmt; -use aabb::surrounding_box; -use aabb::AABB; -use hitable::Hit; -use hitable::HitRecord; -use ray::Ray; +use crate::aabb::surrounding_box; +use crate::aabb::AABB; +use crate::hitable::Hit; +use crate::hitable::HitRecord; +use crate::ray::Ray; pub enum KDTree { Leaf(Box), diff --git a/rtiow/src/material.rs b/rtiow/src/material.rs index c20dfca..1b45be5 100644 --- a/rtiow/src/material.rs +++ b/rtiow/src/material.rs @@ -3,11 +3,11 @@ use std::sync::Arc; extern crate rand; use self::rand::Rng; -use hitable::HitRecord; -use ray::Ray; -use texture::Texture; -use vec3::dot; -use vec3::Vec3; +use crate::hitable::HitRecord; +use crate::ray::Ray; +use crate::texture::Texture; +use crate::vec3::dot; +use crate::vec3::Vec3; fn random_in_unit_sphere() -> Vec3 { let mut rng = rand::thread_rng(); @@ -253,7 +253,7 @@ where #[cfg(test)] mod tests { use super::*; - use texture::ConstantTexture; + use crate::texture::ConstantTexture; #[test] fn arc_material() { diff --git a/rtiow/src/moving_sphere.rs b/rtiow/src/moving_sphere.rs index 3efa9a6..6db0e3c 100644 --- a/rtiow/src/moving_sphere.rs +++ b/rtiow/src/moving_sphere.rs @@ -1,12 +1,12 @@ -use aabb::surrounding_box; -use aabb::AABB; -use hitable::Hit; -use hitable::HitRecord; -use material::Material; -use ray::Ray; -use sphere::get_sphere_uv; -use vec3::dot; -use vec3::Vec3; +use crate::aabb::surrounding_box; +use crate::aabb::AABB; +use crate::hitable::Hit; +use crate::hitable::HitRecord; +use crate::material::Material; +use crate::ray::Ray; +use crate::sphere::get_sphere_uv; +use crate::vec3::dot; +use crate::vec3::Vec3; pub struct MovingSphere where diff --git a/rtiow/src/noise/lode.rs b/rtiow/src/noise/lode.rs index 0cee306..9e26273 100644 --- a/rtiow/src/noise/lode.rs +++ b/rtiow/src/noise/lode.rs @@ -1,8 +1,8 @@ /// Implements the concepts from https://lodev.org/cgtutor/randomnoise.html use rand; -use noise::NoiseSource; -use vec3::Vec3; +use crate::noise::NoiseSource; +use crate::vec3::Vec3; const NOISE_SIZE: usize = 128; pub struct Lode { diff --git a/rtiow/src/noise/mod.rs b/rtiow/src/noise/mod.rs index 5c3d342..6b73549 100644 --- a/rtiow/src/noise/mod.rs +++ b/rtiow/src/noise/mod.rs @@ -3,7 +3,7 @@ pub mod perlin; use std::f32::consts::PI; -use vec3::Vec3; +use crate::vec3::Vec3; pub trait NoiseSource: Send + Sync { /// value returns noise on the interval [0., 1.). diff --git a/rtiow/src/noise/perlin.rs b/rtiow/src/noise/perlin.rs index 66aef0c..8cc7f32 100644 --- a/rtiow/src/noise/perlin.rs +++ b/rtiow/src/noise/perlin.rs @@ -2,9 +2,9 @@ #![cfg_attr(feature = "cargo-clippy", allow(many_single_char_names))] use rand::Rng; -use noise::NoiseSource; -use vec3::dot; -use vec3::Vec3; +use crate::noise::NoiseSource; +use crate::vec3::dot; +use crate::vec3::Vec3; pub struct Perlin { ran_vec: Vec, diff --git a/rtiow/src/ray.rs b/rtiow/src/ray.rs index c52450f..4fc60d1 100644 --- a/rtiow/src/ray.rs +++ b/rtiow/src/ray.rs @@ -1,4 +1,4 @@ -use vec3::Vec3; +use crate::vec3::Vec3; #[derive(Copy, Clone, Debug, Default)] pub struct Ray { diff --git a/rtiow/src/rect.rs b/rtiow/src/rect.rs index 3476ff7..9f011d6 100644 --- a/rtiow/src/rect.rs +++ b/rtiow/src/rect.rs @@ -1,11 +1,11 @@ // There are many math functions in this file, so we allow single letter variable names. #![cfg_attr(feature = "cargo-clippy", allow(many_single_char_names))] -use aabb::AABB; -use hitable::Hit; -use hitable::HitRecord; -use material::Material; -use ray::Ray; -use vec3::Vec3; +use crate::aabb::AABB; +use crate::hitable::Hit; +use crate::hitable::HitRecord; +use crate::material::Material; +use crate::ray::Ray; +use crate::vec3::Vec3; pub struct XYRect where diff --git a/rtiow/src/renderer.rs b/rtiow/src/renderer.rs index 22732c4..9e2fbe6 100644 --- a/rtiow/src/renderer.rs +++ b/rtiow/src/renderer.rs @@ -15,12 +15,12 @@ use num_cpus; use rand; use rand::Rng; -use camera::Camera; -use hitable::Hit; -use ray::Ray; -use scenes; -use texture::EnvMap; -use vec3::Vec3; +use crate::camera::Camera; +use crate::hitable::Hit; +use crate::ray::Ray; +use crate::scenes; +use crate::texture::EnvMap; +use crate::vec3::Vec3; #[derive(Debug)] pub enum Model { diff --git a/rtiow/src/rotate.rs b/rtiow/src/rotate.rs index 370c803..616b14f 100644 --- a/rtiow/src/rotate.rs +++ b/rtiow/src/rotate.rs @@ -2,11 +2,11 @@ use std::f32::consts::PI; use std::f32::MAX; use std::f32::MIN; -use aabb::AABB; -use hitable::Hit; -use hitable::HitRecord; -use ray::Ray; -use vec3::Vec3; +use crate::aabb::AABB; +use crate::hitable::Hit; +use crate::hitable::HitRecord; +use crate::ray::Ray; +use crate::vec3::Vec3; pub struct RotateY where diff --git a/rtiow/src/scenes/bench.rs b/rtiow/src/scenes/bench.rs index d58c7a5..50475f2 100644 --- a/rtiow/src/scenes/bench.rs +++ b/rtiow/src/scenes/bench.rs @@ -1,17 +1,17 @@ use rand; use rand::Rng; -use bvh::BVH; -use camera::Camera; -use hitable::Hit; -use hitable_list::HitableList; -use kdtree::KDTree; -use material::Lambertian; -use renderer::Opt; -use renderer::Scene; -use sphere::Sphere; -use texture::ConstantTexture; -use vec3::Vec3; +use crate::bvh::BVH; +use crate::camera::Camera; +use crate::hitable::Hit; +use crate::hitable_list::HitableList; +use crate::kdtree::KDTree; +use crate::material::Lambertian; +use crate::renderer::Opt; +use crate::renderer::Scene; +use crate::sphere::Sphere; +use crate::texture::ConstantTexture; +use crate::vec3::Vec3; pub fn new(opt: &Opt) -> Scene { let lookfrom = Vec3::new(20., 20., 20.); diff --git a/rtiow/src/scenes/book.rs b/rtiow/src/scenes/book.rs index 3bb66c5..6c5f912 100644 --- a/rtiow/src/scenes/book.rs +++ b/rtiow/src/scenes/book.rs @@ -1,21 +1,21 @@ use rand; use rand::Rng; -use camera::Camera; -use hitable::Hit; -use hitable_list::HitableList; -use kdtree::KDTree; -use material::Dielectric; -use material::Lambertian; -use material::Material; -use material::Metal; -use renderer::Opt; -use renderer::Scene; -use sphere::Sphere; -use texture::CheckerTexture; -use texture::ConstantTexture; -use texture::EnvMap; -use vec3::Vec3; +use crate::camera::Camera; +use crate::hitable::Hit; +use crate::hitable_list::HitableList; +use crate::kdtree::KDTree; +use crate::material::Dielectric; +use crate::material::Lambertian; +use crate::material::Material; +use crate::material::Metal; +use crate::renderer::Opt; +use crate::renderer::Scene; +use crate::sphere::Sphere; +use crate::texture::CheckerTexture; +use crate::texture::ConstantTexture; +use crate::texture::EnvMap; +use crate::vec3::Vec3; pub fn new(opt: &Opt) -> Scene { let lookfrom = Vec3::new(13., 2., 3.); diff --git a/rtiow/src/scenes/bvh.rs b/rtiow/src/scenes/bvh.rs index 3ef5034..8ffc228 100644 --- a/rtiow/src/scenes/bvh.rs +++ b/rtiow/src/scenes/bvh.rs @@ -1,14 +1,14 @@ -use bvh::BVH; -use camera::Camera; -use hitable::Hit; -use material::Lambertian; -use material::Metal; -use moving_sphere::MovingSphere; -use renderer::Opt; -use renderer::Scene; -use sphere::Sphere; -use texture::ConstantTexture; -use vec3::Vec3; +use crate::bvh::BVH; +use crate::camera::Camera; +use crate::hitable::Hit; +use crate::material::Lambertian; +use crate::material::Metal; +use crate::moving_sphere::MovingSphere; +use crate::renderer::Opt; +use crate::renderer::Scene; +use crate::sphere::Sphere; +use crate::texture::ConstantTexture; +use crate::vec3::Vec3; pub fn new(opt: &Opt) -> Scene { let lookfrom = Vec3::new(3., 3., 2.); diff --git a/rtiow/src/scenes/cornell_box.rs b/rtiow/src/scenes/cornell_box.rs index 5c8fcd8..2b574ac 100644 --- a/rtiow/src/scenes/cornell_box.rs +++ b/rtiow/src/scenes/cornell_box.rs @@ -1,22 +1,22 @@ use std::sync::Arc; -use camera::Camera; -use cuboid::Cuboid; -use flip_normals::FlipNormals; -use hitable::Hit; -use hitable_list::HitableList; -use kdtree::KDTree; -use material::DiffuseLight; -use material::Lambertian; -use rect::XYRect; -use rect::XZRect; -use rect::YZRect; -use renderer::Opt; -use renderer::Scene; -use rotate::RotateY; -use texture::ConstantTexture; -use translate::Translate; -use vec3::Vec3; +use crate::camera::Camera; +use crate::cuboid::Cuboid; +use crate::flip_normals::FlipNormals; +use crate::hitable::Hit; +use crate::hitable_list::HitableList; +use crate::kdtree::KDTree; +use crate::material::DiffuseLight; +use crate::material::Lambertian; +use crate::rect::XYRect; +use crate::rect::XZRect; +use crate::rect::YZRect; +use crate::renderer::Opt; +use crate::renderer::Scene; +use crate::rotate::RotateY; +use crate::texture::ConstantTexture; +use crate::translate::Translate; +use crate::vec3::Vec3; pub fn new(opt: &Opt) -> Scene { let lookfrom = Vec3::new(278., 278., -800.); diff --git a/rtiow/src/scenes/cornell_smoke.rs b/rtiow/src/scenes/cornell_smoke.rs index b80e466..a54e9f2 100644 --- a/rtiow/src/scenes/cornell_smoke.rs +++ b/rtiow/src/scenes/cornell_smoke.rs @@ -1,24 +1,24 @@ use std::sync::Arc; -use camera::Camera; -use constant_medium::ConstantMedium; -use cuboid::Cuboid; -use flip_normals::FlipNormals; -use hitable::Hit; -use hitable_list::HitableList; -use kdtree::KDTree; -use material::DiffuseLight; -use material::Lambertian; -use material::Material; -use rect::XYRect; -use rect::XZRect; -use rect::YZRect; -use renderer::Opt; -use renderer::Scene; -use rotate::RotateY; -use texture::ConstantTexture; -use translate::Translate; -use vec3::Vec3; +use crate::camera::Camera; +use crate::constant_medium::ConstantMedium; +use crate::cuboid::Cuboid; +use crate::flip_normals::FlipNormals; +use crate::hitable::Hit; +use crate::hitable_list::HitableList; +use crate::kdtree::KDTree; +use crate::material::DiffuseLight; +use crate::material::Lambertian; +use crate::material::Material; +use crate::rect::XYRect; +use crate::rect::XZRect; +use crate::rect::YZRect; +use crate::renderer::Opt; +use crate::renderer::Scene; +use crate::rotate::RotateY; +use crate::texture::ConstantTexture; +use crate::translate::Translate; +use crate::vec3::Vec3; pub fn new(opt: &Opt) -> Scene { let lookfrom = Vec3::new(278., 278., -800.); diff --git a/rtiow/src/scenes/final_scene.rs b/rtiow/src/scenes/final_scene.rs index 9043fc9..e7d8c02 100644 --- a/rtiow/src/scenes/final_scene.rs +++ b/rtiow/src/scenes/final_scene.rs @@ -4,30 +4,30 @@ use image; use rand; use rand::Rng; -use camera::Camera; -use constant_medium::ConstantMedium; -use cuboid::Cuboid; -use hitable::Hit; -use hitable_list::HitableList; -use kdtree::KDTree; -use material::Dielectric; -use material::DiffuseLight; -use material::Lambertian; -use material::Material; -use material::Metal; -use moving_sphere::MovingSphere; -use noise::perlin::Perlin; -use noise::NoiseType; -use rect::XZRect; -use renderer::Opt; -use renderer::Scene; -use rotate::RotateY; -use sphere::Sphere; -use texture::ConstantTexture; -use texture::ImageTexture; -use texture::NoiseTexture; -use translate::Translate; -use vec3::Vec3; +use crate::camera::Camera; +use crate::constant_medium::ConstantMedium; +use crate::cuboid::Cuboid; +use crate::hitable::Hit; +use crate::hitable_list::HitableList; +use crate::kdtree::KDTree; +use crate::material::Dielectric; +use crate::material::DiffuseLight; +use crate::material::Lambertian; +use crate::material::Material; +use crate::material::Metal; +use crate::moving_sphere::MovingSphere; +use crate::noise::perlin::Perlin; +use crate::noise::NoiseType; +use crate::rect::XZRect; +use crate::renderer::Opt; +use crate::renderer::Scene; +use crate::rotate::RotateY; +use crate::sphere::Sphere; +use crate::texture::ConstantTexture; +use crate::texture::ImageTexture; +use crate::texture::NoiseTexture; +use crate::translate::Translate; +use crate::vec3::Vec3; pub fn new(opt: &Opt) -> Scene { let lookfrom = Vec3::new(478., 278., -600.); diff --git a/rtiow/src/scenes/perlin_debug.rs b/rtiow/src/scenes/perlin_debug.rs index 9248808..32091e7 100644 --- a/rtiow/src/scenes/perlin_debug.rs +++ b/rtiow/src/scenes/perlin_debug.rs @@ -2,19 +2,19 @@ use std::sync::Arc; use rand; -use camera::Camera; -use hitable::Hit; -use hitable_list::HitableList; -use kdtree::KDTree; -use material::Lambertian; -use noise::perlin::Perlin; -use noise::NoiseType; -use renderer::Opt; -use renderer::Scene; -use sphere::Sphere; -use texture::NoiseTexture; -use texture::Texture; -use vec3::Vec3; +use crate::camera::Camera; +use crate::hitable::Hit; +use crate::hitable_list::HitableList; +use crate::kdtree::KDTree; +use crate::material::Lambertian; +use crate::noise::perlin::Perlin; +use crate::noise::NoiseType; +use crate::renderer::Opt; +use crate::renderer::Scene; +use crate::sphere::Sphere; +use crate::texture::NoiseTexture; +use crate::texture::Texture; +use crate::vec3::Vec3; pub fn new(opt: &Opt) -> Scene { let lookfrom = Vec3::new(13., 2., 3.); diff --git a/rtiow/src/scenes/test.rs b/rtiow/src/scenes/test.rs index bf9931f..143dcd6 100644 --- a/rtiow/src/scenes/test.rs +++ b/rtiow/src/scenes/test.rs @@ -1,24 +1,24 @@ use image; use rand; -use camera::Camera; -use hitable::Hit; -use hitable_list::HitableList; -use kdtree::KDTree; -use material::DiffuseLight; -use material::Lambertian; -use noise::perlin::Perlin; -use noise::NoiseType; -use rect::XYRect; -use rect::XZRect; -use rect::YZRect; -use renderer::Opt; -use renderer::Scene; -use sphere::Sphere; -use texture::ConstantTexture; -use texture::ImageTexture; -use texture::NoiseTexture; -use vec3::Vec3; +use crate::camera::Camera; +use crate::hitable::Hit; +use crate::hitable_list::HitableList; +use crate::kdtree::KDTree; +use crate::material::DiffuseLight; +use crate::material::Lambertian; +use crate::noise::perlin::Perlin; +use crate::noise::NoiseType; +use crate::rect::XYRect; +use crate::rect::XZRect; +use crate::rect::YZRect; +use crate::renderer::Opt; +use crate::renderer::Scene; +use crate::sphere::Sphere; +use crate::texture::ConstantTexture; +use crate::texture::ImageTexture; +use crate::texture::NoiseTexture; +use crate::vec3::Vec3; pub fn new(opt: &Opt) -> Scene { let lookfrom = Vec3::new(20., 20., 20.); diff --git a/rtiow/src/scenes/tutorial.rs b/rtiow/src/scenes/tutorial.rs index f0e5654..caefd56 100644 --- a/rtiow/src/scenes/tutorial.rs +++ b/rtiow/src/scenes/tutorial.rs @@ -1,15 +1,15 @@ -use camera::Camera; -use hitable::Hit; -use hitable_list::HitableList; -use kdtree::KDTree; -use material::Lambertian; -use material::Metal; -use moving_sphere::MovingSphere; -use renderer::Opt; -use renderer::Scene; -use sphere::Sphere; -use texture::ConstantTexture; -use vec3::Vec3; +use crate::camera::Camera; +use crate::hitable::Hit; +use crate::hitable_list::HitableList; +use crate::kdtree::KDTree; +use crate::material::Lambertian; +use crate::material::Metal; +use crate::moving_sphere::MovingSphere; +use crate::renderer::Opt; +use crate::renderer::Scene; +use crate::sphere::Sphere; +use crate::texture::ConstantTexture; +use crate::vec3::Vec3; pub fn new(opt: &Opt) -> Scene { let lookfrom = Vec3::new(3., 3., 2.); diff --git a/rtiow/src/sphere.rs b/rtiow/src/sphere.rs index 3c8eb9d..5702039 100644 --- a/rtiow/src/sphere.rs +++ b/rtiow/src/sphere.rs @@ -1,12 +1,12 @@ use std::f32::consts::PI; -use aabb::AABB; -use hitable::Hit; -use hitable::HitRecord; -use material::Material; -use ray::Ray; -use vec3::dot; -use vec3::Vec3; +use crate::aabb::AABB; +use crate::hitable::Hit; +use crate::hitable::HitRecord; +use crate::material::Material; +use crate::ray::Ray; +use crate::vec3::dot; +use crate::vec3::Vec3; pub struct Sphere where diff --git a/rtiow/src/texture/checker.rs b/rtiow/src/texture/checker.rs index 68d016a..c2067cd 100644 --- a/rtiow/src/texture/checker.rs +++ b/rtiow/src/texture/checker.rs @@ -1,5 +1,5 @@ -use texture::Texture; -use vec3::Vec3; +use crate::texture::Texture; +use crate::vec3::Vec3; pub struct CheckerTexture where diff --git a/rtiow/src/texture/constant.rs b/rtiow/src/texture/constant.rs index 766cab8..6eec1a2 100644 --- a/rtiow/src/texture/constant.rs +++ b/rtiow/src/texture/constant.rs @@ -1,5 +1,5 @@ -use texture::Texture; -use vec3::Vec3; +use crate::texture::Texture; +use crate::vec3::Vec3; #[derive(Debug, PartialEq)] pub struct ConstantTexture { diff --git a/rtiow/src/texture/envmap.rs b/rtiow/src/texture/envmap.rs index 312f232..d40e281 100644 --- a/rtiow/src/texture/envmap.rs +++ b/rtiow/src/texture/envmap.rs @@ -2,9 +2,9 @@ use std::f32; use image::RgbImage; -use texture::ImageTexture; -use texture::Texture; -use vec3::Vec3; +use crate::texture::ImageTexture; +use crate::texture::Texture; +use crate::vec3::Vec3; #[derive(Debug)] pub struct EnvMap { diff --git a/rtiow/src/texture/image.rs b/rtiow/src/texture/image.rs index db8bbe6..7d72e95 100644 --- a/rtiow/src/texture/image.rs +++ b/rtiow/src/texture/image.rs @@ -1,7 +1,7 @@ use image::RgbImage; -use texture::Texture; -use vec3::Vec3; +use crate::texture::Texture; +use crate::vec3::Vec3; #[derive(Debug)] pub struct ImageTexture { diff --git a/rtiow/src/texture/mod.rs b/rtiow/src/texture/mod.rs index 7b9956a..e4abead 100644 --- a/rtiow/src/texture/mod.rs +++ b/rtiow/src/texture/mod.rs @@ -3,15 +3,15 @@ mod constant; mod image; mod noise; mod envmap; -pub use texture::checker::CheckerTexture; -pub use texture::constant::ConstantTexture; -pub use texture::envmap::EnvMap; -pub use texture::image::ImageTexture; -pub use texture::noise::NoiseTexture; +pub use crate::texture::checker::CheckerTexture; +pub use crate::texture::constant::ConstantTexture; +pub use crate::texture::envmap::EnvMap; +pub use crate::texture::image::ImageTexture; +pub use crate::texture::noise::NoiseTexture; use std::sync::Arc; -use vec3::Vec3; +use crate::vec3::Vec3; pub trait Texture: Send + Sync { fn value(&self, u: f32, v: f32, p: Vec3) -> Vec3; diff --git a/rtiow/src/texture/noise.rs b/rtiow/src/texture/noise.rs index eeabc05..5f86e56 100644 --- a/rtiow/src/texture/noise.rs +++ b/rtiow/src/texture/noise.rs @@ -1,7 +1,7 @@ -use noise::NoiseSource; -use noise::NoiseType; -use texture::Texture; -use vec3::Vec3; +use crate::noise::NoiseSource; +use crate::noise::NoiseType; +use crate::texture::Texture; +use crate::vec3::Vec3; pub struct NoiseTexture where diff --git a/rtiow/src/translate.rs b/rtiow/src/translate.rs index 1c3e66c..98e72cc 100644 --- a/rtiow/src/translate.rs +++ b/rtiow/src/translate.rs @@ -1,8 +1,8 @@ -use aabb::AABB; -use hitable::Hit; -use hitable::HitRecord; -use ray::Ray; -use vec3::Vec3; +use crate::aabb::AABB; +use crate::hitable::Hit; +use crate::hitable::HitRecord; +use crate::ray::Ray; +use crate::vec3::Vec3; pub struct Translate where